[Community] converting 2D grid to contour polygon shapefiles

Sean Gillies sean.gillies at gmail.com
Tue Aug 2 22:46:16 EEST 2011

On Mon, Aug 1, 2011 at 2:57 PM, Bryan Woods <bwoods at aer.com> wrote:
> 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.


More information about the Community mailing list