Terrain layer

The terrain layer is a special map layer that visualizes the elevation of the scene topography using image data. It also serves as reference elevation for align operations for scene objects such as shapes or graph nodes.

Create a terrain layer

A terrain layer can be created in the following ways:

  • Drag an image from the Navigator into the scene.
  • Import a terrain with File > Import > Terrain Import.
  • Create a terrain layer with Layer > New Map Layer > Terrain .

Terrain options

Heightmap File

Choose an image from your workspace that will be used as a heightmap mesh / digital elevation model. Normally, this is a grayscale image. When a georeferenced image is selected, elevation and bounds are set automatically.

Texture File

Choose an image from your workspace that will be used to texture the heightmap mesh.

Note:

The texture file is applied over the exact extent of the heightmap mesh. It is therefore important that your texture file has the same extent as the heightmap file.

Channel

Choose the source channel from the image that is used to read the data for the elevation. For most images, brightness is the best choice.

Min. elevation

The minimum value / the lower bound for the elevation in meters. For dedicated file types such as GeoTIFF, this value is read automatically from the file.

Max. elevation

The maximum value / the upper bound for the elevation in meters. For dedicated filetypes such as GeoTIFF, this value is read automatically from the file.

Bounds Dimensions

The Width and Height of the resulting terrain in meters. When a georeferenced image is selected, this value is set automatically.

Bounds Location

The location of the resulting terrain in meters. When a georeferenced image is selected, this value is set automatically.

Note:
  • The button right of Location can be used to change the reference point of the terrain's position.
  • It is recommended that you use 32-bit float GeoTIFF files.
  • In addition to 8-bit images, 16-bit and 32-bit images are also supported for heightmap files. The 16/32-bit range is scaled to the elevation bounds similar as is done with standard images.

Terrain layer in a CityEngine scene

The new terrain is added as a new layer in the Scene Editor. If the terrain is not visible in the Viewport, right-click the terrain layer and choose Frame Layer.

Note:

Terrain layers (like all map layers) cannot be selected in the Viewport directly, but only through the Scene Editor.

Terrain layer
A terrain layer is shown.

Inspector options

To change the options of a terrain, you can select the terrain layer in the Scene Editor and review its attributes in the Inspector. with the following options:

Name

Layer name

Visibility

Layer visibility

Locked

Lock terrain layer

Transparency

Layer transparency

Color

Color value multiplied onto layer

Wireframe

Wireframe enabled or disabled

Dimensions

Extent of layer

Location

Location of layer

Elevation Offset

Elevation offset applied to layer. This value is also available as a built-in function in the Layer Attributes code.

Heightmap File

Heightmap file location

Apply Alignments

If enabled, the built-in function elevationDelta in the Layer Attributes code returns the elevation deltas resulting from the terrain alignment tool. If disabled, the function returns 0.

Heightmap Sampling

Bilinear and Nearest Neighbor (hard edges) determine the smoothness of the elevation.

Minimum / Maximum Height

  • The elevation data from the image is mapped into the range [Minimum, Maximum].
  • Both values are also available as built-in functions in the Layer Attributes code.

Basemap

Select the image you want active as your basemap. Click the blank active image to add another basemap.

Base map properties in Inspector
Base map properties in Inspector are shown.

Under Layer Attributes in the Inspector window, you can modify the (editable) CGA code of the elevation.

Overlapping terrain layers

A common scene setup is to have a small but high-resolution terrain layer for your study area and a second overlapping larger but low-resolution terrain layer for the surrounding area.

By default, multiple terrain layers are masked in overlapping regions, such that only the terrain with the highest resolution is shown. This masking avoids blurry artifacts in the overlapping regions stemming from the lower-resolution terrain piercing through the higher-resolution terrain due to the resolution difference.

To disable terrain masking, click View settings View settings > Terrain Masking in the Viewport.

Export terrains

You can export terrains as tile packages (TPK), images, or geometries by selecting the map layer or layers to export.

Export terrains to a tile package

To export terrains to TPK, do the following:

  1. Click File > Export > CityEngine > Export Selected Layers as TPK.
  2. Choose to export both the basemap and elevation terrain files as TPK files or just select one of them.
    • For Scene Environment, you have the option of exporting the terrain for either a global or local scene.
    • If you choose to export both basemap and elevation maps, you will have a {filename}_Basemap.tpk and a{filename}_Elevation.tpk file in your output folder.
  3. Sign in to ArcGIS Online or ArcGIS Enterprise to share the .tpk files with your organization or the public.
  4. Right-click the .tpk file you want to share and click Share as.

    The share Tile Package dialog box appears.

  5. Fill in the necessary fields and click Share.

    Go to the Content tab in your account in ArcGIS Online or ArcGIS Enterprise and publish the TPK as a hosted elevation or tile layer.

Export terrains as an image

To export to image files, select File > Export > CityEngine > Export Selected Terrains as Image and choose a format and resolution. Refer to Export terrain for more information.

Export terrains to geometry files

To export to geometry files, select File > Export > CityEngine > Export Models of Selected Shapes and Terrain Layers and choose a format. The rest of the process is similar to the model exporter.

Note:

The KML and the Esri Scene Layer Package formats do not support exporting terrains.