[Proj] reprojection of sites within SHP file to standard output
Frank Warmerdam
fwarmerdam at gmail.com
Tue Sep 13 21:01:56 EDT 2005
On 9/13/05, Dave Sampson <gis at watersheds.ca> wrote:
> Hey yall,
>
> Been a while since I've posed a question so thought I'd reer the ugly
> head again.
>
> What I am tryin to do is start by using a SHP file with close to 15000
> points. The shp file is suposedly nad27. for each point I would like to
> extract the nad27 co-ordinates of each site, reproject them to nad83,
> and DDMMSS and DDMM.SS to an output file.
>
> the final goal is to have a CSV file that can be imported into a silly
> proprietary dabase. the CSV would look something like
>
> SITEID, NAD27, NAD83, LAT/LONG, DDMMSS, DDMM.SS
>
> I think that's right... projections still confuse this geographer from
> time to time.
>
> I'm not sure if maybe you'd need a NAD27E, NAD27W format.
Dave,
My suggestion would be to write a python script to do this
using OGR to read the shapefile, and the OGR wrappers
for GDAL to handle the datum shift. Of course, many other
possible solutions exist too but you need to put something
together for reading the shapefiles, and something for doing
the datum shift. OGR is convenient in having both.
If you look at:
http://www.gdal.org/srctree/pymod/samples
you should find a "tolatlong.py" script that gives a brief
idea how to deal with coordinate transformations, and a
assemblepoly.py script that demonstrates reading features
with OGR.
Quite a bit of work would have to be done to put it all
together of course. The following tutorials might also
be of help.
http://www.gdal.org/ogr/osr_tutorial.html
http://www.gdal.org/ogr/ogr_apitut.html
You can use the FWTools build if you need a package
with Python, OGR and PROJ.4 and nicely pre-setup
(win32 or linux).
http://fwtools.maptools.org/
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Proj
mailing list