Mapping in python? Transforming shapefile so that basemap can readthem?

C

C Barr Leigh

I'm trying to get started with plotting maps in python. I need to read
"shape files" (.shp) and make maps. There seem to be many efforts but
none is complete? I'm looking for suggestions and troubleshooting.

The basemap package is obviously at an impressive stage and comes with
some data:
http://www.scipy.org/Cookbook/Matplotlib/Maps

but it cannot read shapefiles when their coordinates are not in
geographic projection. min are in a lambert, so the readshapefile
fails.

Apparently there is a utility that can convert a .shp file to lat/lon
coordinates, but it fails for me. “You can convert the shapefile to
geographic - coordinates using the shpproj utility from the shapelib
tools - (http://shapelib.maptools.org/shapelib-tools.html)"
For me, this gives:
“unable to process projection, exiting...”

Has anyone overcome these problems?

Thanks!
Chris
 
M

Mart.

I'm trying to get started with plotting maps in python. I need to read
"shape files" (.shp) and make maps. There seem to be many efforts but
none is complete? I'm looking for suggestions and troubleshooting.

The basemap package is obviously at an impressive stage and comes with
some data:http://www.scipy.org/Cookbook/Matplotlib/Maps

but it cannot read shapefiles when their coordinates are not in
geographic projection. min are in a lambert, so the readshapefile
fails.

Apparently there is a utility that can convert a .shp file to lat/lon
coordinates, but it fails for me. “You can convert the shapefile to
geographic - coordinates using the shpproj utility from the shapelib
tools - (http://shapelib.maptools.org/shapelib-tools.html)"
 For me, this gives:
“unable to process projection, exiting...”

Has anyone overcome these problems?

Thanks!
Chris

Not sure - but perhaps the GDAL?
 
A

Andrew MacIntyre

C said:
I'm trying to get started with plotting maps in python. I need to read
"shape files" (.shp) and make maps. There seem to be many efforts but
none is complete? I'm looking for suggestions and troubleshooting.

The basemap package is obviously at an impressive stage and comes with
some data:
http://www.scipy.org/Cookbook/Matplotlib/Maps

but it cannot read shapefiles when their coordinates are not in
geographic projection. min are in a lambert, so the readshapefile
fails.

Apparently there is a utility that can convert a .shp file to lat/lon
coordinates, but it fails for me. “You can convert the shapefile to
geographic - coordinates using the shpproj utility from the shapelib
tools - (http://shapelib.maptools.org/shapelib-tools.html)"
For me, this gives:
“unable to process projection, exiting...”

Someone else has already mentioned GDAL which is actually the raster
part of the GDAL/OGR duo; OGR is the vector toolset which understands
shapefiles. There are a couple of other packages possibly worth exploring:
- Thuban (http://thuban.intevation.org)
- GRASS (http://grass.itc.it/)
- Shapelib (http://shapelib.maptools.org/)
- FWTools (http://fwtools.maptools.org/)

Shapefiles, except for the coordinate system support included in ESRI's
more recent products, are documented in a publicly accessible PDF which
googling for "ESRI shapefile" should find.

--
 

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top