Skip to main content
Question

Build 3d lines by overlaps on DTM: tuning

  • September 17, 2025
  • 5 replies
  • 78 views

pdorio
Contributor
Forum|alt.badge.img+8

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?

5 replies

nielsgerrits
VIP
Forum|alt.badge.img+61

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?)


pdorio
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • September 17, 2025

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


takashi
Celebrity
  • September 17, 2025

Hi ​@pdorio ,

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


pdorio
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • September 18, 2025

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.


takashi
Celebrity
  • September 18, 2025

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.