[FWTools] Question About Shapefile Reprojection With FWTools/OGR2OGR

Frank Warmerdam warmerdam at pobox.com
Mon Oct 26 14:17:33 EST 2009

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



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 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 FWTools mailing list