[Gdal-dev] Python/OGR SHAPE creation: prj file missing

Markus Neteler neteler at itc.it
Wed May 31 17:12:23 EDT 2006


Frank, Matthew,

cool, works!

Markus


On Wed, May 31, 2006 at 01:20:50PM -0700, Matthew Perry wrote:
> Markus,
> 
>  I usually cheat and just copy and existing .prj from a dataset with
> the same projection. But it can be accomplished other ways as well.
> 
> If it's just an EPSG code, there the epsg_tr.py utility:
>  epsg_tr.py -wkt 4326 > ${shapefile_prefix}.prj
> 
> Or if you want to do it within a python script:
> 
> srs = osr.SpatialReference()
> srs.ImportFromProj4(.....)
> ## Or for EPSG codes
> srs.ImportFromEPSG(int(....))
> prj = srs.ExportToWkt()
> ## write the prj string to the appropriate file
> 
> - Matt
> ~
> 
> On 5/31/06, Markus Neteler <neteler at itc.it> wrote:
> >Hi,
> >
> >I was writing a simple Python script to generate a
> >SHAPE file following
> > http://www.perrygeo.net/wordpress/?p=4
> >(thanks, Perry!).
> >
> >The SHAPE related files are created, but the .prj file not.
> >How to enable that?
> >
> >thanks
> >
> > Markus
> >_______________________________________________
> >Gdal-dev mailing list
> >Gdal-dev at lists.maptools.org
> >http://lists.maptools.org/mailman/listinfo/gdal-dev
> >
> 
> 
> -- 
> Matt Perry
> perrygeo at gmail.com
> http://www.perrygeo.net
> 

-- 
Markus Neteler     <neteler itc it>       http://mpa.itc.it
ITC-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy



More information about the Gdal-dev mailing list