Skip to main content

Hello everyone,

I need to transform a 2D road graph into 3D. Each vertex of the lines should receive the correct Z value from a DTM.

I found this solution, which works very well:

 

 

The problem with this workflow is that it is very slow. My region is very large: the graph has about 150,000 elements, and the vertex extractor generates more than 2,000,000 vertices, which slows down the script.

 

Any suggestions?

Not sure if this is faster, but I think the SurfaceDraper was created to do this?

(Just to be sure, when doing a production run, FeatureCaching is off right?)


Thank you ​@nielsgerrits but the SurfaceDraper is 10-15% slower than my workflow..


Hi ​@pdorio ,

I suppose that using Chopper (Mode: By Vertex, Maximum Vertices: 1) instead of VertexExtractor could be faster.


Thank you ​@takashi!

i have tried the Chopper: is more faster: 4 minutes against 11 minutes!!!

 

but the VertexExtractor give as output the  attributes  feature_number, part_number and vertex_number. Those attributes are helpful to rebuild correctly the lines with the LineBuilder.

 

Now I need to assess whether reconstructing the lines with the chopper output becomes too complicated overall and slower than my original flow.


Another option, since the source features are lines, you can directly send the lines into SurfaceDraper without decomposing them into points beforehand and also rebuilding lines later. Not sure if the performance is better but I think it's worth to try.

Just be aware that the interpolation method in SurfaceDraper is different from one in PointOnRasterValueExtractor, so the result could not be exactly the same.