Import SHP (Esri Shapefile)

Shapefile is a legacy format of Esri to describe geo-referenced GIS features (points, lines, polygons and limited multipatches). It has limited support for GIS attributes and should be considered superseded by Esri FileGDB.

Import settings

The shapefile import has the following options:

File

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

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

Coordinate System

  • The importer reads the .prj projection file of the shapefile. If successful, the corresponding coordinate system is displayed in the dialog. Otherwise, a pop-up dialog asks the user to choose a coordinate system.
  • Please make sure 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 in the Object Attributes tab.
  • To use these attributes with the CGA grammar you need to declare CGA attributes with matching names. A simple CGA rule file could look like this:
    attr height = 10
    Lot --> extrude(height)
  • After assigning this rule file to the shapes, the CGA attribute height appears in the Object Attributes tab of the Inspector.

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 settings

Run Generate Bridges Tool after Import

If enabled, the Generate Bridges Tool is executed on a following wizard page.

Run Simplify Graph Tool after Import

If enabled, the Simplify Graph Tool is executed on a following wizard page.

Run Graph Cleanup Tool after Import

Depending on the shapefile data it may be necessary to cleanup the graph segments after import. If enabled, the graph cleanup tool is executed on a following wizard page.

Create Street/Intersection Shapes from Graph

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

Create Block/Lot Shapes from Graph

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

Map shapefile attributes

If enabled, an imported graph layer will contain the following layer attribute code:

Map shape attributes
Map shape attributes

This mapping controls the width of the street shapes generated from the graph center lines. In the default behaviour, the object attribute width is used to determine the resulting street width, and defaults to 8 if no object attribute is found.

Advanced users can edit the default mapping code by changing the cga code in the file shp.ceattr, located in /ce.lib/rules/.