Wednesday 24 October 2012

GDAL Contour

I wanted to create some contours from a DEM file today and decided to use GDAL instead of Arc or FME and I was again pleasantly surprised by the simplicity and power of the GDAL environment. My first port of call was to read the documentation, which showed that this command's syntax does not differ greatly from
the rasterize command discussed in the last post.

I decided to generate a set of 10m contours as a shapefile using the following command:


The switches do the following:
  •  -b 1 selects the band of the image to process, which defaults to 1
  •  -a elevation is the name of the contour elevation attribute which will be created
  • -snodata -9999 tells GDAL the value of nodata cells in the input raster, so they can be ignored
  • ns67ne.tif contour.shp are the input and output files, respectively
  • -i 10 is the spacing between each contour

1 comment:

  1. ?I used to be very pleased to search out this web-site.I wished to thanks to your time for this glorious learn!! I undoubtedly having fun with every little little bit of it and I've you bookmarked to take a look at new stuff you weblog post. gsn casino games

    ReplyDelete