[Gdal-dev] help on ogr2ogr to assign Spatial reference system

Mateusz Loskot mateusz at loskot.net
Mon Jun 11 03:52:22 EDT 2007


Nimalika wrote:
> I tried with the quotes but still fails and this time no error
> message.
> 
>> ogr2ogr -f "ESRI Shapefile" -a_srs "+proj=tmerc +ellps=ev
> rst30 +lat_0=7.00048 +lon_0=80.77171 +k=0.9999238418 +x-0=2000000 
> +y_0=200000 +u nits=m" D:\Reserch\Kaduwela\Kaduwela\gn_kaduwela.shp 
> Usage: ogr2ogr [--help-general] [-skipfailures] [-append] [-update] 
> [-select field_list] [-where restricted_where] ..... anny help is
> appriciated much.

Your command is incomplete.
According to the manual (http://www.gdal.org/ogr/ogr2ogr.html)
you need to provide dst_datasource_name *and* src_datasource_name
OGR does not support in-place update, so the overall procedure looks as
follows:

1. ogr2ogr ... output_data my_existing_data
2. Delete (or move somewhere) my_existing_data
3. Rename output_data to my_existing_data

Usually, users wrap these steps with a script ie. in Bash.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list