[gdal-dev] Re: Question about Reprojecting a Shapefile

Tom Russo russo at bogodyn.org
Wed Nov 2 15:05:40 EDT 2011


On Thu, Nov 03, 2011 at 05:23:42AM -0400, we recorded a bogon-computron collision of the <gdal-dev-request at lists.osgeo.org> flavor, containing:
> 
> Message: 1
> Date: Wed, 2 Nov 2011 17:33:40 +0000
> From: katrin eggert <katrineggert1980 at gmail.com>
> Subject: [gdal-dev] Question about Reprojecting a Shapefile
> To: gdal-dev at lists.osgeo.org
> Message-ID:
> 	<CAGR7mtBL2qa7my3NassZvKfiaUNK63PkkSf6XkDUiKicBrZOGQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi I'm trying to reprojec a shapefile using
> ogr2ogr -f "esri Shapefile" -t_srs EPSG:32736 Areas_.shp reproj_parcel.shp
> but I get this error:
> FAILURE:
> Unable to open datasource `reproj_parcel.shp' with the following drivers.
> 
> with:
> ogr2ogr -t_srs EPSG:32736 Areas_.shp reproj_parcel.shp
> I also get the same error.
> Any tip on what am I doing wrong? (it seems to be a pretty simple thing to
> do)


Try: 
ogr2ogr -t_srs EPSG:32736 reproj_parcel.shp Areas_.shp

A somewhat counter-intuitive tidbit about ogr2ogr is that it takes the
destination file as the FIRST argument and the source as second, unlike 
other GDAL tools or most *nix tools.

As ogr2ogr will tell you without any arguments:
Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update]
               [-select field_list] [-where restricted_where]
               [-progress] [-sql <sql statement>] [-dialect dialect]
               [-preserve_fid] [-fid FID]
               [-spat xmin ymin xmax ymax]
               [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
               [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...]
               dst_datasource_name src_datasource_name
               ^^^                 ^^^
               [-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]]


This has bitten me from time to time, since 
"programname sourcefile destinationfile" trips off the fingers so lightly.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 "One man alone can be pretty dumb sometimes, but for real bona fide
 stupidity, there ain't nothin' can beat teamwork." - Edward Abbey



More information about the gdal-dev mailing list