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

Nimalika nimalika.f at sliit.lk
Mon Jun 11 09:28:53 EDT 2007


Dear M.L,

Thank you so much. It works fine. My error was that no destination file was 
added.

I add the code for anybody who is having same type of issue.

>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" gn_kaduwela_ref.shp D:\Reserch\Kaduwela\Kaduwela\gn_kaduwela.shp

resulting .proj file looks like follows.

PROJCS["Transverse_Mercator",GEOGCS["Everest 
1830",DATUM["D_unknown",SPHEROID["evrst30",6377276.345,300.8017]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",7.00048],PARAMETER["central_meridian",80.77171],PARAMETER["scale_factor",0.9999238418],PARAMETER["false_easting",0],PARAMETER["false_northing",200000],UNIT["Meter",1]]

I tried to add datum parameter also . Can anybody suggest from where to get 
valid datum names ? I tried with D_Kandawala, kadawala both but they are not 
correct.

Best Regards

Nimalika




----- Original Message ----- 
From: "Mateusz Loskot" <mateusz at loskot.net>
To: "Nimalika" <nimalika.f at sliit.lk>
Cc: <gdal-dev at lists.maptools.org>
Sent: Monday, June 11, 2007 1:22 PM
Subject: Re: [Gdal-dev] help on ogr2ogr to assign Spatial reference system


> 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