Import SHP (Esri Shapefile)

Shapefile is an Esri legacy format used to describe georeferenced GIS features (points, lines, polygons, and limited multipatches). It has limited support for GIS attributes and should be considered superseded by Esri FileGDB.

Import options

For shapefile import, the following options are available:

OptionDescription

File

  • Click Browse to open a dialog box and select an .shp file to import.
  • After opening a file, the dialog box detects the shape type of the file. The type is displayed in the header of the dialog box (for example, Shape Type: POLYGON. Importing shapes). The following types can be imported as shapes: Polygon, PolygonZ, PolygonM, Multipatch, Point, and PointZ. Other types are imported as graph segments.

Note:
  • Shapefiles containing points can also be imported. In this case, a marker (0.1 x 0.1m quad) is created for each point.
  • Shapefile polygons containing negative polygons that cut holes into polygons are not supported and are imported as normal shapes instead of holes.

Coordinate System

  • The .prj file of the shapefile is read by SHP import. If successful, the corresponding coordinate system is displayed on the dialog box. Otherwise, a pop-up prompts you to choose a coordinate system.
  • Ensure that the input shapefiles use the same coordinate units in the planar and up directions. CityEngine does not support separate units for the planar and up directions.

Using Attributes from SHP file

  • A .shp file has an accompanying .dbf file that contains associated attributes for elements. After importing the .shp file, these attributes appear in the Inspector window on the Object Attributes tab.
  • To use these attributes with the CGA grammar, you must declare CGA attributes with matching names. A simple CGA rule file may look like this:
    attr height = 10
    Lot --> extrude(height)
  • After assigning this rule file to the shapes, the height CGA attribute appears on the Object Attributes tab of the Inspector window.

Note:
The Source field is set to Object, which denotes that the CGA height attribute is controlled by the object attribute of the lot.

Graph options

The following graph options are available:

OptionDescription

Run Generate Bridges Tool after Import

If enabled, the Generate Bridges tool is run on a subsequent wizard page.

Run Simplify Graph Tool after Import

If enabled, the Simplify Graph tool is run on a subsequent wizard page.

Run Graph Cleanup Tool after Import

Depending on the shapefile data, it may be necessary to clean up the graph segments after import. If enabled, the Cleanup Graph tool is run on a following wizard page.

Create Street/Node Shapes from Graph

If enabled, the shape creation parameter of the graph nodes and segments is enabled and street shapes are created.

Create Block/Lot Shapes from Graph

If enabled, the shape creation parameter of potentially created street blocks is enabled and shapes are created.

Map shapefile object attributes

Consider the following when working with shapefile object attributes:

  • When importing streets, if you want to map attributes, prepare the data field names to include strtWdth , sdwlkWdthR,  and sdwlkWdthL. Check the Map Shapefile Attributes check box in the Shapefile dialog box to generate lane shapes with unique widths in the Viewport window. When imported, the Object Attributes section in the Inspector window will display the field names as streetWidth, sidewalkWidthRight and sidewalkWidthLeft.
  • The streetWidth attribute represents the total width of the roadbed visualized as two lanes. If the width value is defined as 0, then no lane shapes are generated.
  • When the Map Shapefile Attributes check box is unchecked, default lanes are generated to include a two-lane roadbed (8 meters wide) flanked by two sidewalks (each 2 meters wide), regardless of the attributed values. The same result also appears if the data fields have not been defined by the strtWdth , sdwlkWdthR,  and sdwlkWdthL names.