Exporting road network splines

388
1
02-28-2018 03:57 AM
BernhardRainer
New Contributor

Hi, 

I'm currently working on a traffic simulation that should run above a CityEngine scene. Therefore I need to rebuild the graph network in my application. 

Until now, I've exported the graph network as SPH files. However, I can't recreate the road network correctly since the SPH file lacks intersection parameters and spline information (tangents at the vertices). 

Is there a way of enriching the SPH export to include intersection and spline information or is there an entirely different exporter that is able to export more than just the connectivity information of the graph? 

Thanks for your help!

Cheers,

Bernhard

Tags (2)
0 Kudos
1 Reply
ThomasFuchs
Esri Regular Contributor

SHP generally does not support curved segments.

However all values needed can be accessed from Python, exported as attributes and reconstructed later on.
To define curves, CityEngine uses Cubic Bézier curves.

The position of the Points P1 and P2 can be accessed via Python and added as Object Attributes to the segment (Python Scripting - CE.setAttribute).

# direction = P_1 / startNode = P_0
directionStart = ce.getCurveHandle( segmentAB, nodeStart )

# direction = P_2 / startNode = P_3‍‍
directionEnd   = ce.getCurveHandle( segmentAB, nodeEnd )

The intersection type can also be queried with Python:

ce.getAttribute(node, '/ce/crossing/type')
0 Kudos