Discussion:
[Community] converting 2D grid to contour polygon shapefiles
Bryan Woods
2011-08-01 20:57:24 UTC
Permalink
I am wondering if anyone has experience or tips on how to convert a
fixed 2D lat/lon grid to contoured polygon shapefiles. I've figured out
how to use Basemap to produce the contours. My stumbling block right now
is converting those contours into reliable shapefiles. Any help would be
appreciated!

Thanks,
Bryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bwoods.vcf
Type: text/x-vcard
Size: 341 bytes
Desc: not available
URL: <http://lists.gispython.org/pipermail/community/attachments/20110801/eea519b1/attachment.vcf>
Sean Gillies
2011-08-02 19:46:16 UTC
Permalink
I am wondering if anyone has experience or tips on how to convert a fixed 2D
lat/lon grid to contoured polygon shapefiles. I've figured out how to use
Basemap to produce the contours. My stumbling block right now is converting
those contours into reliable shapefiles. Any help would be appreciated!
Thanks,
Bryan
What form do the basemap/matplotlib contours take? Numpy arrays?
Assuming that you have a contour line with a scalar attribute and
represented by an array of longitudes and an array of latitudes, you
can write a shapefile using ogr.py, one feature per line. None of the
software supported by this here email list (Shapely, etc) write data
to disk in GIS formats.
--
Sean
Mike Toews
2011-08-03 04:01:42 UTC
Permalink
gdal_contour -a elev dem.tif contour.shp -i 10.0
-Mike

[1] http://www.gdal.org/gdal_contour.html
[2] http://www.gdal.org/formats_list.html
I am wondering if anyone has experience or tips on how to convert a fixed 2D
lat/lon grid to contoured polygon shapefiles. I've figured out how to use
Basemap to produce the contours. My stumbling block right now is converting
those contours into reliable shapefiles. Any help would be appreciated!
Thanks,
Bryan
Loading...