VS: [mapserver-users] Converting datum using ogr2ogr

NASUNO Isao isao.nasuno at ctc-g.co.jp
Thu May 15 03:42:27 EDT 2008


Hi Jukka, and List,

I got to the conversion that I expect with your advice.
Now I understand how to use it.

Many thanks !

Isao

Rahkonen Jukka wrote:
> Hi Isao,
> 
> I am sorry, I must admit that I haven't done my homework with datum shifting.
> However, I believe that reason for not getting any change in your reprojection
> is because the definition in the FWTools epsg ligrary for epsg:4301 is this:
> # Tokyo
> <4301> +proj=longlat +ellps=bessel +no_defs  <>
> 
> So it gives no towgs parameters which would tell what kind of shifting should 
> be done.  For comparison, this projection using bessel does have towgs84
> parameters and a trial with that should lead to different result:
> # Bukit Rimpah
> <4219> +proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,0 +no_defs  <>
> 
> If you can find somewhere the towgs84 parameters and insert them to your source 
> projection you may get what you want.  It is not necessary to edit the epsg text
> file but even better to give the projection directly for ogr2ogr this way:
> 
> ogr2ogr -s_srs "+proj=longlat +ellps=bessel +towgs84=-384,664,-48,0,0,0,0 +no_defs" -t_srs epsg:4326
> 
> Of course with your correct towgs84 parameters.  This way it is simple to play with 
> adjusting the parameters, and most important, you know for sure what parameters
> ogr2ogr is going to use. It is possible that right parameters for you are
> TOWGS84=-148,507,685,0,0,0,0 but I can't be sure. It was just the first hit from
> altavista search.
> 
> -Jukka Rahkonen-
>  
> 
>> -----Alkuperäinen viesti-----
>> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
>> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta NASUNO Isao
>> Lähetetty: 15. toukokuuta 2008 7:59
>> Vastaanottaja: Rahkonen Jukka
>> Kopio: mapserver-users at lists.osgeo.org
>> Aihe: Re: [mapserver-users] Converting datum using ogr2ogr
>>
>> Hi Jukka,
>>
>> Thank you for your response.
>>
>> yes, I tried with the options (s/t_srs), however it makes 
>> conversion for projection but not for datum.
>>
>> In my case, I used following options but the input and output 
>> are exactly same.
>>
>>   -s_srs "EPSG:4301"   -t_srs "EPSG:4326"
>>   (GCS with bessel)    (GCS with WGS84)
>>
>> I checked GDAL FAQ and found following.
>>
>> http://trac.osgeo.org/gdal/wiki/FAQCoordinateSystemsAndProject
>> ions#WhydoesntGDALautomaticallychoosethedatumtransformation
>> ------------------------------------
>> Why doesn't GDAL automatically choose the datum transformation?
>>   There is no such thing as an accurate "default" set of 
>> datum transformation
>>   parameters for a datum. OGR uses (NADCON) by default, which 
>> is the most
>>   accurate available for North America, but in the general 
>> case (worldwide)
>>   this is very hard to determine and there normally is no 
>> such thing as a default.
>>   The transformation that should be used depends on the exact 
>> area covered,
>>   accuracy required etc. In other words, user beware and do 
>> your homework.
>> ------------------------------------
>>
>> Is this the reason ?
>> I am not sure if ogr2ogr can accept the parameters in manual.
>> Please help if any idea.
>>
>> Thanks,
>>
>> Isao
>>
>>
>> Rahkonen Jukka wrote:
>>> Hi,
>>>
>>> I don't think you need .prj file with your shapefiles and 
>> you should be able even to overrun it.
>>> You need to use parameters -s_srs for source projection and 
>> -t_srs for target projection.
>>> -Jukka Rahkonen-
>>>
>>>
>>> -----Alkuperäinen viesti-----
>>> Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: NASUNO 
>>> Isao
>>> Lähetetty: to 15.5.2008 4:59
>>> Vastaanottaja: mapserver-users at lists.osgeo.org
>>> Aihe: [mapserver-users] Converting datum using ogr2ogr
>>>  
>>> Hello,
>>>
>>> I am new in the mailing list.
>>>
>>> I want to use ogr2ogr to convert projection/datum of shape 
>> files to a 
>>> same SRS before insert them into postgres for serving by MapServer.
>>>
>>> However ogr2ogr seems convert only projection even the 
>> shape file has .prj file.
>>> I checked out that GDAL has no default parameters to convert datum.
>>>
>>> I need the conversion before inserting to postgres with 
>> some reasons, 
>>> I mean, with translation from shape to shape.
>>>
>>> Any suggestion to convert datum using ogr2ogr or other 
>> stand-alone program ?
>>> - The ogr2ogr is included in FWTools 2.1.0.
>>> - OS is windows xp.
>>>
>>> Thanks,
>>>
>>> Isao NASUNO
>>>



More information about the mapserver-users mailing list