[gdal-dev] Deriving a new raster attribute layer from a polygon layer

Chris Diehl chris at lightfield.ag
Tue Dec 6 18:26:59 PST 2022


Hello everyone,

I am trying to discern how I can accomplish the following at the command
line with GDAL and could use some guidance. I have a GeoTIFF containing
data from the National Land Cover Database and I would like to add another
raster layer to the GeoTIFF that contains land management labels for the
centroids of each pixel in the NLCD raster. I have a GeoJSON file that has
polygons representing areas with a particular land management label. At the
end of the day, I'd like to produce a GeoTIFF with two bands, one
representing the land cover type and another representing the land
management type.

I located this example
<https://gis.stackexchange.com/questions/365258/spatial-join-between-raster-and-shapefille-give-raster-the-shapefile-values-w>
that I believe is a Python-based solution to my problem but the code is
producing an empty GeoTIFF. I assume if a solution path does exist, there's
a way to do this at the command line which would be preferable.

If someone can point me in the right direction, I would be very grateful!
I'm struggling to see how to get there from the GDAL docs.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221206/baa7cb26/attachment.htm>


More information about the gdal-dev mailing list