4

I have a 3D network of streams represented using linestrings with Z-coordinates. I would like to rasterise this feature, where the raster values represent the linearly interpolated Z-values between 3D coordinates from the linestring verticies. I have all open source and Esri tools available, but I don't see any simple solution.

Did I miss an available tool to do this conversion, or do I need to make one myself? (I have a few ideas floating around my head, but it would probably take the better part of an afternoon to code out.)

1
  • 1
    It would be nice to know this answer. I used to convert polyline to evenly spaced points and than to raster.
    – Tomek
    Commented Jun 26, 2012 at 7:52

1 Answer 1

3

I've not tried it, but GDAL's gdal_rasterize should do the trick with its -3d option:

gdal_rasterize -3d -tr 10.0 10.0 -l streams streams.shp streams.tif
2
  • 1
    This is a really excellent tool! It also has an API "GDALRasterizeLayers" with intriguing options; for Python, see help(gdal.RasterizeLayer)
    – Mike T
    Commented Jun 26, 2012 at 22:57
  • Could pose as a new question, but what if you had multiple Z values within a linestring? Such as starting coord z=1 and ending coord z=2? Doesn't seem like gdal_rasterize works for that.
    – Binx
    Commented Mar 29, 2023 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.