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.

Creating a Terrain Layer

A Terrain Layer can be created in the following ways:

  • An image is dragged from the Navigator into the scene.
  • A terrain is imported with File > Import > Terrain Import.
  • A new Terrain Layer is created with Layer > New Map Layer > Terrain .

Terrain options

Heightmap File

Choose an image from your workspace which will be used as heightmap mesh / Digital Elevation Model. Normally this is a greyscale image. When a georeferenced image is selected, elevation and bounds are set automatically.

Texture File

Choose an image from your workspace which 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 filetypes like 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 like 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 to use 32-bit float geoTiffs.
  • In addition to 8-bit images, also 16-bit and 32-bit images are supported for heightmap files. The 16/32-bit range is scaled to the elevation bounds similar as it 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 on the Terrain Layer and choose Frame Layer.

Note:

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

Terrain layer
Terrain layer

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/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

Resolution

The number of terrain mesh vertices in u and V direction.

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.

Layer Attributes

Contains the (editable) cga code for evaluation of the elevation.

Base map

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

Base map properties in Inspector
Base map properties in Inspector

Export terrains

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

Export terrains to 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's 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 chose 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's with your organization or the public.
  4. Right-click the TPK file you want to share and click Share as.....

    This opens the share Tile Package dialog.

  5. Fill out 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 image

To export to image files, select File > Export... > CityEngine > Export Selected Terrains as Image and choose a format.

Export terrains to geometry

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.