Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf ·...

15
Tutorial 4: Import streets Copyright © 1995-2013 Esri. All rights reserved.

Transcript of Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf ·...

Page 1: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved.

Page 2: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Table of ContentsTutorial 4: Import streets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 2

Page 3: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Tutorial 4: Import streetsIn this tutorial:

• Part 1: Import DXF Street Data

• Part 2: Import OSM Street Data

• Part 3: Import Shapefile Street Data (and GDB)

Download:

• Tutorial Data

• Tutorial PDF

Part 1: Import DXF Street Data

CityEngine Street Networks

CityEngine street networks are attributed graphs, consisting of graph nodes (crossings) and graph edges (street segments). They caneither be generated with the street grow feature, created inside CityEngine, or imported via an external file, such as DXF.

Preparing Street Data for CityEngine

For this example, the main road structure for a seaside city has been sketched in Illustrator using its path and geometry tools.

Export .dxf File from external CAD Applications

When exporting the street network, make sure units are fitting the CityEngine unit system, which interprets numbers in imported filesas meters always. You might want to open the .dxf in a text editor and look for the vertex data to see what dimensions are written out.In this example, we set an export scale of 1 pixel equals 10 units to get the dimensions we needed (see export options screenshot)

Some vertex data generated by the DXF export:Vertex data

...AcDb2dVertex10

1244.9995117187520

234.99804687530

0.00

VERTEX...

Suggested options in Illustrator's DXF file export dialogue:

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 3

Page 4: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Import .dxf File into CityEngine

Steps:

1. Open the scene file sesame_01.cej.

2. Locate the .dxf file sesame_streetsketch.dxf in the data folder.

3. Right-click the file and choose Import.The data Layer Layer 2 is already added as Graph layer to be imported.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 4

Page 5: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

4. Make sure Run Graph Cleanup Tool after Import is checked.

5. Click Next.

6. Enable Intersect Segments, Snap Nodes to Segments and Merge Nodes.

7. Set Snapping distance to 1, Merging Distance to 5.

8. Click Finish.

A new Graph Layer called ‘sesame_streetsketch’ appears in the Scene Editor. Alternatively, you could open the scenefile ‘sesame_02.cej’ to get the scene with the imported data.

Grow minor streets

Once the major streets are imported, you can start to refine the street network and grow the minor streets in between. The StreetGrow Algorithm in the CityEngine tries to fill existing closed blocks, so you can iteratively fill the street blocks with streets.

Steps:

1. Focus the street block you want to create minor streets.

2. Create two single small streets using the graph edit tool.

This a) specifies the general orientation of the streets in the block and b) defines a starting node for the Street GrowAlgorithm.

3. Manually, create some street segments.

4. Select the segments (q key), then start filling in the blank areas with the Grow Streets dialog.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 5

Page 6: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

The scene file ‘sesame_03.cej’ contains the finished street network.

Final result

The scene file ‘sesame_12.cej’ contains a finished street network with extracted and subdivided lots as seen in the image below.

Sesame City with generated minor streets and extracted building footprints:

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 6

Page 7: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Sesame City with simple buildings and vegetation models:

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 7

Page 8: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Part 2: Import OSM Street Data

"OpenStreetMap is a project aimed squarely at creating and providing free geographic data such as street maps to anyone who wantsthem." -- openstreetmap.org

OpenStreetMap

OSM is a XML-based format to describe vector data used in a map. It defines three basic types such as nodes, ways and closedways which are used to describe all the other elements:

• Nodes: The dots that are used for drawing segments between.

• Ways: An ordered list of nodes, displayed as connected by line segments in the editor.

• Closed Ways: Closed ways are ways which go in a complete loop. They are used to describe areas like parks, lakes orislands.

Export an OSM File from OpenStreetMap

The .osm data for this tutorial (area of historical Pompeii) was downloaded from: api.openstreetmap.org/api/0.6/map?bbox=14.4798600,40.7454200,14.4984500,40.7550800

Find the .osm file into the data folder of your current CityEngine project.

Import an OSM File into the CityEngine

Steps:

1. Open a new scene file File > New > CityEngine > CityEngine scene.

2. Drag the file into the 3D viewport.

3. In the OSM import dialog, choose what layers to import. Normally, all streets are in the highway layer, buildings in thebuilding layer. Use the Select / deselect all checkbox to deselect all layers if necessary.

4. Set the additional options as in the image below.

5. Click Finish.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 8

Page 9: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

6. Accept the suggested coordinate system WGS 1984 UTM Zone 33N.

7. Click OK.

Two new layers (street network and shapes) appear in the Scene Editor, and the osm data is visible in the 3D viewport,with automatically created street shapes on the imported street centerlines.

8. Rename the graph network layer to OSM_Streets.

9. Rename the shape layer to OSM_Shapes.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 9

Page 10: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Street widths

If you have a close look at the generated street shapes, you will notice that they differ in width. When importing OSM data with theMap OSM tags option enabled, CityEngine creates layer attributes that define street widths from OSM street types.

Steps:

1. Select a street segment and look at its parameters in the Inspector.

On the example shown below, a street with highway type tertiary has assigned street and sidewalk width parameters, according tothe layer attribute mapping from the imported OSM Layer OSM_Streets.

You can manually modify the street width by setting a new width value to the streetWidth parameter (the value will change to a user-set value), or using the Street Edit Tool from the toolbar.

OSM Attribute Mapping

Steps:

1. Select the new graph network layer in the Scene Editor, and look at the layer attribute code in the Inspector.

The street segment in the image above was of type tertiary, and is mapped to 6 meters in the function streetWidthByClass. You canchange the mapping here according to your taste.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 10

Page 11: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

#2012.1//-------------------------// Example OSM Tag Mappingstreetscale = 1 // street width scale factorwidth = getObjectAttr("width")lanes = getObjectAttr("lanes")attr streetWidth = // street width dependeding on available attributes

case width > 0 : width * streetscalecase lanes > 0 : lanes * 3 * streetscaleelse : streetWidthByClass * streetscale * oneway

class = getObjectAttr("highway")streetWidthByClass =

case class == "primary" : 8case class == "secondary" : 7case class == "tertiary" : 6case class == "motorway" : 12case class == "trunk" : 11case class == "road" : 6case class == "residential" : 5case class == "footway" : 2case class == "cycleway" : 2case class == "steps" : 2else : 4

oneway = // oneway width correctioncase getObjectAttr("oneway") == "yes" : 0.5else : 1

sidewalkscale = 1 // sidewalk width scale factorsidewalkWidth =

case class == "primary" : 2case class == "secondary" : 2case class == "tertiary" : 2case class == "residential" : 2else : 0

attr sidewalkWidthLeft = sidewalkWidth * sidewalkscaleattr sidewalkWidthRight = sidewalkWidth * sidewalkscale

Conflicting data

Imported osm data often is not very clean, and leads to conflicts (e.g. overlapping streets). Open blocks or red dotted lines areindications of unconnected segments or overlapping streets which can lead to invalid blocks. There are different ways to deal withsuch conflicts:

• Use the Cleanup Graph Tool with with different parameters.

• Try to select less streets from the highway layer in the import dialog.

• Set street and sidewalk widths to smaller values (resulting in less overlapping streets).

• Manually clean up the street network after import by combining or removing nearby crossings, nearby parallel streets.

An example of unconnected graph nodes, before and after cleaning:

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 11

Page 12: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Note: OSM street data usually contains elevation data (attribute level), but it may be faulty. If you activate theRun Generate Bridges Tool option, CityEngine will automatically figure out a possible solution to dealwith this.

Adding a Map Layer With Satellite Imagery

Steps:

1. Click File > Import > CityEngine Layers > Texture Import.

2. Browse to the file pompeii_satellite.jpg in the maps folder.

3. Use the suggested coordinate system WGS 1984 UTM Zone 33N for the image.

4. Size (bounds) and Offset (Location) are set automatically thanks to the world file pompeii_satellite.jgw.

5. Click Finish to create the new texture map layer.

Note: CityEngine does not reproject images on import. Choosing the coordinate system on image import isonly used to calculate the correct location information. It is therefore crucial to have image data preparedin the projection used in the CityEngine scene. (In the case above, the Pompeii satellite image has beenreprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate System used for this tutorialscene).Satellite map added to OSM street data:

Generate models

Steps:

1. Select all shapes.

2. Assign the rule file osm_generic.cga.

As some shapes have already a valid start rule set, the following dialog appears. Just press Skip.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 12

Page 13: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

3. Generate.

As you may have noticed, only the streets have been generated. The building shapes seem not to have been generated.Select one of them and note in the Inspector, that there is no start rule assigned.

4. To fix it, right-click on the selected shape in the viewport and choose Select > Select Objects with Same Start Rulefrom the context menu. This will select all shapes with no start rule set.

5. In the Inspector click the Select button next to the Start Rule field. From the Set Start Rule dialog choose Lot.

6. Generate again.

Simple generic models, generated on OSM data:

Part 3: Import Shapefile Street Data (and GDB)

Note that importing streets from shp files and geodatabase files is almost identical, thus a specific example for the gdb is not shownhere.

The shapefile data

Steps:

1. Locate the file streets.shp in the data folder of the tutorial project.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 13

Page 14: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

The shp file has a .prj file along, which ensures correct georeferencing on import. The data consists of Polylines, whichwill import as street segments in CityEngine. The dataset contains an attribute width, which will control street width withinCityEngine.

Attribute table of the shp file as displayed in ArcMap:

Import data

Steps:

1. Create a new empty CityEngine scene.

2. Drag the shp file from the Navigator into the 3D viewport. Drag and Drop will use the default settings, which is fine in thiscase.

3. During import, CityEngine will ask to choose a Scene Coordinate System. The projection defined for the shp file issuggested as default, and is a good choice here.

Note: The shp data in this example contains the width attribute to control the street width. Data with no suchattribute will result in default street widths. Street widths can also be set manually after import. Mappingsto other attribute names are possible as well using attribute mapping. See CityEngine Manual for details.

Cleanup

The imported street shapes show some conflicting street shapes, marked with red dotted lines. Use the Cleanup Graph Operationwith Resolve Conflicting Shapes enabled to fix those automatically. Also, the ‘Simplify Graph Tool’ does a great job reducingunneeded complexity of graph segments by approximating the graph by deleting unneeded graph settings and setting the tangents.Please also consult the manual in the ‘street network’ section.

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 14

Page 15: Tutorial 4: Import streets - ArcGISresources.arcgis.com/.../10.2/tutorial_4_import_streets.pdf · 2013-12-05 · reprojected in ArcMap to WGS 1984 UTM Zone 33N (the Scene Coordinate

Assign rule file

Steps:

1. Select all street shapes.

2. From the File Navigator, drag the rule file sesame_01.cga from the projects rule folder onto the selected shapes in the3D viewport.

Simple Street Models are generated.

Underlying street network and generated Models:

Tutorial 4: Import streets

Copyright © 1995-2013 Esri. All rights reserved. 15