TransWikia.com

Converting raster to line vector layer

Geographic Information Systems Asked by Sophie Crommelinck on October 23, 2020

I would like to convert all values having the value 1 in a binary raster to a line vector layer. The following image shows the binary raster (1=white and 0=black):

binary raster

The optimal output would look like the red lines in the following image (which I realized by modifying the GDAL script raster to vector line):

raster to lines

However, this is very slow and not applicable on large rasters. Is there a similar open-source implementation (callable in Python) that does the same with less processing time?

Would it decrease the processing time of the GDAL script raster to vector line when writing each single wkbLineString to a shapefile instead of adding them all to a wkbMultiLineString before writing them to a shapefile?

The only related posts I found so far are referring to polygonizing the raster (which I realized with GRASS GIS r.to.vect), which creates polygons and thus two lines, where I need only one:

raster to polygons

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP