Question About Shapefile Reprojection With FWTools/OGR2OGR

View: New views
2 Messages — Rating Filter:   Alert me  

Question About Shapefile Reprojection With FWTools/OGR2OGR

by Sunburned Surveyor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using FWTools for the first time, and I'm trying to figure out the
command I would use to get OGR2OGR to perform a coordinate
transformation on an ESRI Shapefile. I can't seem to get the syntax
for the command correct, and I was hoping to get some help here.

I'm trying to reproject a shapefile named "roads.shp" from WGS84 to
California State Plane Zone 3. The resulting file should be named
new_road.shp. I know my EPSG codes are 4326 and 2227.

Here is the command that I think is the closest to what I need, after
some trial and error:

ogr2ogr -s_srs EPSG::4326 -t_srs EPSG::2227 -f "ESRI Shapefile"
C:/Temp/my_data/roads.shp C:/Temp/my_data/new_roads.shp

ogr2ogr reports that EPSG::2227 is not found in the support files. I
thought this was a fairly common map projection. Is there a problem
with my command syntax? Do I need to add support for this EPSG code to
FWTools? Can you point me towards the documentation I would use to do
that?

Thanks,

The Sunburned Surveyor
_______________________________________________
FWTools mailing list
FWTools@...
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/

Re: Question About Shapefile Reprojection With FWTools/OGR2OGR

by Frank Warmerdam-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sunburned Surveyor wrote:

> I'm using FWTools for the first time, and I'm trying to figure out the
> command I would use to get OGR2OGR to perform a coordinate
> transformation on an ESRI Shapefile. I can't seem to get the syntax
> for the command correct, and I was hoping to get some help here.
>
> I'm trying to reproject a shapefile named "roads.shp" from WGS84 to
> California State Plane Zone 3. The resulting file should be named
> new_road.shp. I know my EPSG codes are 4326 and 2227.
>
> Here is the command that I think is the closest to what I need, after
> some trial and error:
>
> ogr2ogr -s_srs EPSG::4326 -t_srs EPSG::2227 -f "ESRI Shapefile"
> C:/Temp/my_data/roads.shp C:/Temp/my_data/new_roads.shp

Landon,

Try:

ogr2ogr -s_srs EPSG:4326 -t_srs EPSG:2227 new_roads.shp roads.shp

To note:

  o Only one colon between EPSG and the number.
  o The files are listed output file then input file.
  o the default output format is shapefile and does not need to be specified

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
FWTools mailing list
FWTools@...
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/