Tutorial 4: Import streets

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

Scene with street configurations

CityEngine represents street networks as graphs consisting of nodes and segments.

  • Nodes define where segments start, end, and connect.
  • Segments can be straight or curved and displayed as centerlines, basic lane shapes organized into sidewalk and roadbed groups, lanes with rule-generated materials or more complex lanes that include rule-generated 3D models.

You can import streets into CityEngine in various formats, including import Open Street Map (OSM) data, as described in the Build cities with Get Map Data tutorial; georeferenced FileGDB or shapefiles with preserved object attributes; and DXF design sketches.

After importing, you can:

  • Edit streets using the Street Creation tools Polygonal Street Creation tool.
  • Assign procedural rules to lane shapes.
  • Customize lanes with the Street Designer tools Street Designer , saving your designs as reusable configurations.

Alternatively, use the Grow Streets tool to procedurally generate street networks based on different patterns to either extend your imported networks or create new ones.

In this tutorial, you will learn how to import streets from different data sources, define lane widths by mapping attributes to specific field names, select streets using different methods, apply street configurations, apply rules to nodes, and correct common errors in imported data.

Import a DXF file

A DXF (Drawing Exchange Format) is a vector file format commonly used by designers, architects, and engineers to collaborate and exchange drawings such as sketches of proposed site layouts. It is also supported as an export format by some industry-standard graphic design applications, in which illustrations are often created and edited.

In this section, you will import a street layout from a DXF. You will then use a side-by-side view to edit the imported street layout so that it matches a reference layout in an existing scenario: Start.

Add a DXF file

To import a DXF file into your CityEngine scene, do the following:

  1. Expand the Tutorial_04_Import_Streets tutorial folder in the Navigator window.
  2. Open the Import_dxf.cej in the scenes folder:

    • The Start scenario is active in the Scene Editor window.
    • In the Scene Editor window, there is an unlocked Graph layer called Main Development representing the proposed street network.
    • In the Viewport window, the Main Development streets appear aligned to the Terrain layer which has an elevation of 0.
    • The Main Development streets have different street configurations and node types assigned.

    Main Development scene

  3. In the Scene Editor window, create a new scenario named DXF.

    New DXF scenario

  4. Keep the ID and Color entries as the default and click OK.
  5. In the Navigator window, expand the data folder and right-click the Melton.dxf file.
  6. Click Import.

    Import DXF dialog box

    Alternatively, select the .dxf file and click File > Import in the main menu.

    Note:
    In this example, the data for Melton, Australia, uses a metric coordinate system, so metric display units are used. If you prefer to explore the scene or work in imperial units [ft] (feet), you can change the display units at any time under Edit > Preferences > Appearance > Display Units. Changing the Display Units preference only affects how units are displayed in the user interface. It does not change the coordinate system of the scene or convert object attributes.

    The Main Development data is added as a graph layer to import.

    Tip:
    If your street design is being prepared and exported in an app which supports writing to the Autodesk DXF format such as Rhino or CAD, convert the units to meters beforehand since the CityEngine coordinate system is in meters.

  7. Ensure that the Run Graph Cleanup Tool after Import and Create Street/Nodes Shapes from Graph check boxes are checked to show the street centerlines represented as a connected street network of segments and nodes when imported.
    Cleanup Graph dialog box
  8. Click Finish to see a street network imported with two roadbed lanes in-between two sidewalk lanes.

    These lanes are shapes with no rules assigned.

    Street network after cleanup

  9. Click Window > Layout > 2 Scenarios Side-by-side in the main menu:

    2 Scenarios Side-by-side layout

  10. The Start scenario displays beside the DXF scenario.
  11. In the Scene Editor window, click the Default layers button Default Objects to deselect it and hide the context layers for both scenarios.

    Default layers button

    The Main Development Streets are stand-alone in the Scene Editor window and in the side-by-side scenario viewports.

  12. In either scenario, expand the Bookmarks Bookmarks menu menu, and click the View_05 bookmark.

    Bookmark menu

    The bookmark has adjusted the linked scenarios to show the top view.

    Two scenarios side-by-side

Note:
When you compare the imported DXF streets to the Start scenario streets, you can see that all segments are straight. This is because CityEngine currently does not support curved DXF geometries such as arcs or splines on import.

Match the street geometries of the scenarios

Next, you will adapt the street geometries in each scenario to match using the Street editing tools Street editing tools.

  1. In the DXF scenario, remove a joint node in the top left a of the study area by completing the following steps:
    1. Select the joint and click the Remove Nodes tool Remove Nodes tool or press C+R:

      Joints selected

      Remove Nodes tool

    2. Click the joint to remove the node.

      Remove node

      A curved street segment remains.

    3. Switch to the Edit Streets/Curves tool Edit street/curves tool or press C and adjust the curve with the green handles.

      Adjusting the curve

  2. In the DXF scenario, there are segments near the lower end of the study area that do not match the Start scenario. Press Q to activate the Select tool Select tool. Then, press and hold Shift and click the three segments highlighted in the following image to select them. Press Delete to remove them.

    Highlighted DXF segments to delete

  3. Click the Street creation tools Polygonal Street Creation tool.

    In the Polygonal Street Creation tool options Tool options, the Re-use settings from neighbors toggle button is on by default. This allows you to maintain the existing settings of the streets you are drawing connections to without the need to reassign a rule, configuration, or adjust the lane layouts and widths.

    Polygonal Street Creation tool

  4. Add the segments highlighted in the image below to match the Start scenario:

    Segments added to match the Start scenario

  5. In the Start scenario, click to select a single segment to display the assigned street configuration in the Inspector window.

    Selected street configuration

    Tip:

    The Street Configuration section has the option to sort and change the view to either a tile or list view.

  6. In the DXF scenario, click the same segment and assign the street configuration to match the Start scenario.
  7. Keep the street selection the same and click to Select > Select Continuous Graph Objects in the main menu.

    Select Continuous Graph Objects

    1. Leave the default dialog box options as they are and click Apply.

      Select Continuous Graph Objects dialog box

      All connected streets are traversed and selected:

      Connected streets selected

  8. Use this selection to apply the same street configuration applied to the last segment.

    Street configuration applied to selection

    You will notice that the node shapes do not have a rule assigned. All nodes require a separate rule assignment.

  9. In the Scene Editor window of the DXF scenario, right-click the Network layer and click Select Objects. In the Inspector window, click the Node Roadbeds button Node Roadbed and click Assign.
  10. Assign the Default_Node.cga rule file in the ESRI.lib/rules/Streets/Node folder.

    Assign Default.Node.cga rule in Inspector Window

    1. The nodes also have sidewalks. Click the Node Sidewalks button Node Sidewalk and assign the same rule again.

      Node Sidewalks button

  11. Continue this continuous selection workflow to match the street configurations in the DFX scenario to the street configurations in the Start scenario.
    1. To create roundabouts, select the desired node and change the Type parameter to Roundabout in the Node Parameters section.

      Type parameter set to Roundabout

    2. You can also update the Street Materials for the roundabout island where necessary:

      Street Materials in roundabout

  12. In the DXF scenario, click View_04 in the Bookmarks menu Bookmarks menu.
  13. Click Window > Layout > Default Layout in the main menu.
  14. Click the Default layers button Default Objects in the Scene Editor window to display the final result of your DXF import.

    DXF import

  15. Optionally, you may prefer to hide the linear graph network in the scene.
    1. Open the Visibility settings Visibility settings located at the top right of the DXF scenario in the Viewport window.
    2. Uncheck Graph Networks or press F10.

      Unchecked visibility settings

Import file geodatabase data

When working with GIS data, a file geodatabase is the preferred container format for data preparation and import into CityEngine. You can define specific field names within a file geodatabase, which are recognized by CityEngine when imported as numeric field types.

Once imported, these fields are referred to as object attributes in CityEngine and can be found in the Object Attributes section in the Inspector window. If the dataset includes these recognized object attributes, the graph network is automatically mapped creating lane shapes with predefined widths based on the original attribute values:

Recognized object attributes:

  • streetWidth
  • sidewalkWidthRight
  • sidewalkWidthLeft

When working with both file geodatabases and shapefiles, if your data does not include width information, you can choose between two alternative representations. The street network can either be displayed as a preset default with two roadbed lanes in-between two sidewalk lane shapes with uniform widths or just the centerlines with no lane shapes. When preparing your GIS data for import, it is helpful to first decide your preferred outcome.

Attribute Mapping

Lane Shapes Generated

Street Width Representation

Import graph with mapped attributes using the standard field names

Yes

Unique widths imported from data

Widths imported

Import graph without standard field names

Yes

Preset default with uniform widths

Uniform widths

Import graph with 0 or Null widths

No

No widths, centerlines only

Centerlines only

To import the file geodatabase, do the following:

  1. Create a new scene called Import_fgdb.cej.
  2. In the data folder, right-click the BeverlyHills.gdb file and click Import.

    Tip:
    If you have a file geodatabase saved locally on your computer, you can alternatively go to File > Import > CityEngine Layers > File GDB Import and browse for your data.

  3. Ensure the Import and map attributes check box is checked.
  4. Uncheck the Create Block/Lot Shapes from Graph on Import check box.

    FileGeodatabase import dialog box

  5. Click Finish to open the Select Scene Coordinate System dialog box:
    Select Scene Coordinate System

    Note:

    A local coordinate system is assigned to the feature class inside the file geodatabase: NAD 1983 (2011) StatePlane California V FIPS 0405 (US Feet)

  6. Click OK.

    Imported FileGeodatabase

    Tip:

    • While working, consider adjusting your scene in the View Settings View settings of the Viewport window.
    • Press D+G to turn on and off the grid in the scene – this makes it easier to see your changes when you are working with street centerlines or shapes.
    • Press D+C to display the compass in the scene – this is helpful to orient your view when working in a georeferenced scene.

The data has been prepared so that you can easily search attributes for particular locations. When searched using the Scene Editor window, locations with unique object attribute names will be framed in the Viewport window similar to the way bookmarks behave. You can use this same method when preparing your file geodatabase for import into CityEngine.

Fix errors in a street network

When two connected nodes are very close, sometimes the lanes can’t be created. In this case, the segment is marked with a dashed red line. Use the Street editing tools Street editing tools to fix these errors in your street network.

  1. In the Scene Editor window, search for FixStreet1 and press Enter.

    FixStreet1 in Scene Editor

    A street segment displaying an error is framed and selected in the Viewport window:

    Street with error in Viewport window

  2. Click the Remove Nodes tool Remove Nodes tool.

    Notice that the Fit to Curve toggle button is turned on by default. This will maintain the curvature of the connected segment.

    Remove Nodes tool

  3. Click the node on the right side of the red error indicator (nodes are visually represented as points on the graph network) to remove it.

    Node to remove with Remove Nodes tool

    After you click, the error is gone, the connected street segments have a much cleaner appearance, and a curve of the selected segment remains.

    Street fixed after removing node

  4. In the Scene Editor window, search for FixStreet2 and press Enter.

    FixStreet2 in Scene Editor window

    Another segment with an error is framed in the Viewport window.

  5. This time, use the Edit Streets/Curves tool Edit street/curves tool to update the position of the uppermost node.

    Edit Streets/Curves tool

  6. Click and drag the yellow disk on the upper left, further up in the northwest direction (NorthWest).

    The yellow disk constrains moving the street on the same horizontal plane, whereas the orange ball moves the street in 3D space.

    Edit Street/Curves tool used in Viewport window

    The error indicator disappears from the segment.

    Street fixed using Edit Street/Curves tool

  7. In the Scene Editor window, search for FixNodes.

    FixNodes in Scene Editor window

    Three nodes sharing an intersection are selected in the Viewport window:

    Intersection with errors

  8. Click the Merge Nodes tool Merge Nodes tool.
    Merge Nodes tool

  9. Click the leftmost node and click the center node to merge it.

    The left node is merged

  10. Repeat this for the rightmost node.

    The right node is merged

    Alternatively, you can also click and drag the Merge Nodes tool Merge Nodes tool to make a window selection of multiple nodes.

  11. Press Ctrl+S to save the scene and keep it open.

Create a street layout with CGA rules

To create a street layout with CGA rules, complete the following steps:

  1. In the Scene Editor window, search for Isolated.

    At the bottom of the segment, there is a node selected as well. Click the Select tool Select tool then press and hold Ctrl to click the node, leaving only the segment selected in the Viewport window:

    Street selected to add CGA rule

  2. With the segment still selected, press I to isolate this segment.

    This allows you to temporarily hide anything that is not selected in the scene so that you can then measure, edit, assign rules, and perform other operations on that geometry without affecting the other scene objects.

  3. Click the Measure Distance tool Measure distance and measure the total street width on the edge of the isolated segment.

    Measured distance compared to values in Object Attributes

    You will see that the measurement units match the local coordinate system units (feet) and the measured distance matches the total street width including the sidewalks and roadbed. Compare how these values appear in the Object Attributes section previously calculated in feet and meters.

    Note:

    If your original data is in a different unit of measurement, you must convert the values to meters before importing into CityEngine to visualize the correct lane widths as done in this dataset.

  4. Click in the whitespace to deselect the isolated segment.
  5. In the Navigator window, expand the ESRI.lib folder:

    • ESRI.lib/rules/Streets/Lane/Vehicle
    • ESRI.lib/rules/Streets/Lane/Sidewalk

    Lane rules in ESRI.lib

  6. Click and drag the following rules directly from the Navigator window onto shapes in the Viewport window to assign them. Using this method, the models and textures are generated automatically:
    1. Drag the Sidewalk_Lane.cga onto the two outer lane shapes.
    2. Drag the Car_Lane.cga onto the inner left lane shape
    3. Drag the Bike_Lane.cga onto the inner right lane shape

      Bike lane on a street

  7. Click to select the bike lane.
  8. In the Inspector window, expand the Street Material section.
  9. Change the Surface attribute from Red Asphalt to Green Asphalt.

    Notice that the user set attribute now appears bold in the Inspector window:

    Bike lane Surface parameter changed to Green Asphalt

  10. In the Inspector window, click the Segment button Segment parameters and ensure that the Street Configuration section is expanded.
  11. Click the + symbol to add your selected design as a custom street configuration.
  12. Rename the Configuration to Residential Bike Street.

    If your Street Configuration menu is filtered by recently added, it will be at the top of the list in both tile and list view.

    Residential Bike Street configuration

    The other pre-existing street configurations are provided out-of-the-box from ESRI.lib. You can update, rename, or delete them from your project as needed.

  13. Press I again so that the segment is no longer isolated.

Import street configurations from a different scene

Street configurations are unique to each scene (cej) file. Every time you create a new scene, CityEngine adds a set of initial street configurations to get you started. If you want to import custom street configurations you created in a different scene, you can import them using the CEJ import option. Also, if you’ve updated or deleted the initial street configurations originally in your scene and want to restore them, you can import them from the Generic_Street_Configurations.cej scene in the ESRI.lib/scenes/Streets folder.

To import a custom configuration into your Import_fgdb.cej scene, complete the following steps:

  1. Click File > Import > CityEngine Layers > CEJ Import in the main menu.
  2. Click Next.
  3. Click Browse to find the Import_fgdb_final.cej file in the scenes folder.
  4. Uncheck everything in the list except the Footway check box.
  5. Click Finish.

    Footway street configuration chosen on import

    The new configuration appears in the Inspector window when the Street Designer is activated.

    Footway street configuration

Assign configurations by attribute

The search feature in the Scene Editor window allows you to quickly check for keywords in your data. When you have more than one layer in the Scene Editor window, lock the layers that you do not want to query before searching. In this section, you will be asked to search for predetermined attributes in the imported Beverly Hills street network.

  1. Use the Scene Editor window to search for the useType attribute called primary.

    Searched for primary in useType attribute

  2. After searching, the streets will automatically be selected and framed in the scene:

    Streets with primary as the useType attribute

  3. Assign the Residential_Street_2VL_17.5m street configuration.
  4. In the Scene Editor window, right-click the Beverly Hills layer and click Select Objects to select all street segments and nodes.
  5. In the Inspector window, click the Node Roadbeds button Node Roadbed and assign the Default_Node.cga rule.

    Default_Node.cga rule assigned to node roadbeds

  6. Click the Node Sidewalks button Node Sidewalk and assign the Default_Node.cga rule again.

    Default_Node.cga rule assigned to node sidewalks

  7. Assign different street configurations to each useType attribute using the following out-of-the-box and custom options:

    useType

    Source

    Configurations

    footway

    Imported

    Footway

    primary

    ESRI.lib

    Residential_Street_2VL_17.5m

    residential

    Custom

    Residential Bike Street

    secondary

    ESRI.lib

    Simple_Street_Generic_2VL_17.20m

    service

    ESRI.lib

    Neighborhood_Alley_1Way_1VL_10m

  8. Save your scene and explore the bookmarks in the Import_fgdb_final.cej scene.

Footway:

Footway

Primary and Residential Bike Street:

Primary and Residential Bike Street

Note:

You can also import the legacy GIS shapefile (SHP) format following the same workflow as the preferred and fully supported FGDB format described in this section.

In this tutorial, you learned how to do the following:

  • Import streets using different data types.
  • Understand how lane widths can be predetermined by mapping attributes with specific field names.
  • Explore street selection methods.
  • Apply street configurations and perform basic edits to clean up possible errors found in the imported data.

To continue your learning with CityEngine, see the complete CityEngine tutorial catalog.