[gdal-dev] Question on gdal_contour and limiting the range of contours generated.

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Wed Oct 30 13:35:35 PDT 2019


Hi,

I want to use gdal_contour to generate shapefile contours which is 
pretty straight forward except I'm working with coastal relief data that 
has both elevation and bathymetry. I only want contours for the bathymetry.

I tried setting the -off -5 and -i -5 with the idea that this would 
start me at a depth of -5 and generate contours every -5 units deeper, 
but the generated an empty files. Seems like -i parameter can not be 
negative (should be mentioned in the docs).

This sets the depth to 400ft and generates contours every 5 ft above that:

gdal_contour -off -121.92 -i 1.524 bathy-value/crm_vol2.nc.tif 
bathy-contours/crm_vol2.nc-5.shp

How can I stop/limit the process and stop at 0 (ie: sea level)? I don't 
want land elevation contours. Like a -limit 0 argument?

If this can't be done, it would be a nice option to have so you can 
breakup contours into multiple shapefiles to avoid overflowing them

Thanks,
   -Steve

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list