Tutorial 17: Desert city

To access the tutorials in CityEngine, click Help > Download Tutorials and Examples. After choosing a tutorial or example, the project is automatically downloaded and added to your workspace.

Explore the Desert City scene file

  1. Double-click the Desert City scene file, which is located in the scene folder.
  2. Click Generate in the first dialog box that opens.

    This starts the model generation of all elements.

    Desert City main view of all elements

  3. Navigate through the scene and explore the buildings, streets, and vegetation.

    You’ll notice that only a fraction of all buildings are generated by default. This saves memory resources.

  4. Edit some rule parameters, such as Building_Height, Building_Usage, or Level of Detail.
  5. Select some more building footprints or street shapes (click or draw a selection rectangle).
    Note:

    There is different behavior if you select left-right or right-left with a selection rectangle.

  6. Click the Generate button on the toolbar or press Ctrl+G to start the model generation of the newly selected shapes.
    Overview of the city after rule modifications

Recreate the full scene

The complete Desert City scene is composed of a GIS data and a rule set. The GIS data includes attributed footprint shapes, street center lines, vegetation markers, wall lines, and electric power lines. All that data is contained in a geodatabase file (GDB). Since there are different data types used (lines, polygons, points), each object type is stored in a different layer.

  1. Open the Desert_City_terrain_only scene file.
    Desert City geodatabase layers displayed in ArcMap

Import GIS data

  1. In the Navigator window, locate the data folder. From within the data folder, drag the DesertCityGDB.gdb into the 3D viewport.

    The File Geodatabase Import dialog box appears.

    CityEngine File Geodatabase Import dialog box
  2. Uncheck the TerrainExtent layer.
  3. Click Next, and in the following settings, activate the Merge Nodes option with a Merging Distance value of 2, and click Finish.

Align the imported GIS data to the terrain

In the Scene Editor, you see that all layers were created, but nothing is yet visible due to the fact that all elements come in at 0 elevation. You must project them to the correct heights and realign the terrain accordingly:

  1. Hide the PowerLines, Structures, and Vegetation layers.
  2. Select all visible in the viewport with a large selection rectangle.
  3. Click Graph Menu > Align Graph To Terrain.
  4. Project to the terrain with an Offset value of 0.4 meters.
  5. Click Shapes Menu > Align Shapes To Terrain
  6. Click Maximum of the Shape, and set Offset to 0.2 Meters
    Note:

    Translating keeps the shapes horizontal and flat.

  7. Click Layer Menu > Align Terrain To Shapes ...
  8. Align the terrain with a value of +- 250 meters.
  9. Invert the visibility of all layers, so the previously hidden ones are now visible and vice versa.
  10. For the upcoming alignments, leave the terrain as it is currently.
  11. Project the graphs (Walls and PowerLines) with an Offset value of –0.5 meters.
  12. Translate the shapes (Structure and Vegetation Markers) to the maximum of the shape, with an Offset value of -0.5 Meters.
    Align Shapes dialog box

CGA rule assignment

Now, you will assign the according CGA rules to each specific object type. To do so, activate each layer’s visibility one after the other to select all shapes for the rule assignment.

The following are the most common ways to assign rules:

  • Drag the rule from the Navigator directly onto selected shapes in the viewport.
  • Use the Assign button in the Inspector window.
  • Right-click a layer.

Since the Marker shapes (Structures and Vegetation) are small, it is tricky to assign the rule via dragging. Instead, right-click those layers and select all objects in the same layer, and assign the rule in the Navigator.

Streets

> Desert_City_Streets.cga

PowerLines

> Desert_City_Powerlines.cga

Walls

> Desert_City_Walls.cga

Buildings

> Desert_City_Buildings.cga

Structures

> Desert_City_Structures.cga

Vegetation

> Desert_City_Vegetation.cga

Increase texture resolution in the city center

CityEngine stores all textures (raster images) for the 3D display in the video memory of the graphics card, so the recommended maximum resolution for all texture files is 4000x4000 pixels, which may not be enough detail for large areas. (See the Esri Community post Textures - raster files: concepts in CityEngine-ArcGIS).

To increase the quality of the terrain texturing under the buildings locally, activate the dynamic block subdivision and use the new lot shapes as a ground underneath the buildings. On that additional ground, you'll map a higher-resolution texture.

  1. First, hide all layers except the Street layer.
  2. Select blocks with a right-left rectangle selection. In the Inspector, click the Blocks tab and change the shapeCreation parameter to true, and set the lotAreaMin and Max to 2’000 and 4’000.
  3. In each block, select one shape, right-click, and select all shapes in the same group. Once you have the selection, assign the rule called Desert_City_ParcelTexturing.cga.
  4. Click Generate.

Plan a new school

The .gbd file for this chapter is available in the data folder as DesertCity_Intervention.gdb. If you are not interested in the manual creation of that data, skip this section.

Next you'll recreate a real-world focus intervention. At the following block near the city center, you'll plan a new school with a soccer field in the following chosen city block.

Imagery of new school location in a city center block

  1. Open the dataset in ArcMap.
  2. Create a blank map in ArcMap and import the feature classes from the example dataset as layers.
  3. Create a new .gdb file, name it MyIntervention.gdb and save it to your project’s data folder on your hard drive.
  4. Create the following feature classes:

    • Polygon Features, named Intervention_Buildings

      Add the following attributes:

      • Building_Height (of type float)
      • Building_Usage (of type text)
    • Polygon Features, named Intervention_Soccer_Field

      Add no attributes:

    • Point Features, named Intervention_Vegetation

      Add the following attributes:

      • Size (of type float)
    • Line Features, named Intervention_Walls

      Add the following attributes:

      • width (must be lowercase) (of type float)

  5. Draw one or multiple school buildings, with realistic heights in meters, and set the Building_Usage attribute to school.
  6. Create some walls as polylines, set width to 0.4 meters.

    The width value will be mapped directly.

  7. Create a rectangular soccer field.
  8. Distribute some vegetation points and set their Size attributes to realistic values between 2 and 15 meters.
  9. Click Save.
  10. If you did not create the .gdb file in the project’s data folder, move or copy it there.
  11. To refresh the workspace, click File > Refresh Workspace.

Import the intervention data

As described above, drag the new .gdb file into the 3D viewport to start the import. Of course, you can choose either the .gdb file you have created yourself or the one with the example, DesertCity_Intervention.gdb.

  1. Align the shapes and graphs to the terrain.
  2. Assign the rules.

    There’s also a rule for the soccer field.

  3. If the soccer field is created in the wrong direction, set the attribute Orientation_Change to true.
    Imported soccer field terrain