2

I have a binary raster (values - 0 & 1) - I want to create a shapefile (KML for use in Google Earth) of the white area only (value = 1). Is there a simple method to do this?

Image

  • I'm unsure what, if anything, you have tried already to accomplish this, but here is a similar question that uses GDAL to convert raster to KML. gis.stackexchange.com/questions/143344/… – MaryBeth Dec 10 '15 at 15:19
  • I think the best way is to extract the area you want into its own individual file first, then convert it to KML. You can do this by using raster calculator to extract the area marked as "1" (Raster Calculator Tool); then convert to .kml (via .shp or polygon is you want) – Corey Pembleton Dec 10 '15 at 15:21
2

This can be done with gdal_polygonize in one go:

gdal_polygonize -mask binary-raster.tif binary-raster.tif -f KML output.kml

The -mask option is used to only regard non-zero values as valid - therefore keeping only the white area of your image.

In QGIS you can find gdal_polygonize under Raster -> Conversions -> Polygonize.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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