Opened 16 years ago

Closed 13 years ago

#2047 closed defect (wontfix)

ogr2ogr ignores datumtransformation using towgs84

Reported by: mlechner Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SRS Version: 1.4.3
Severity: normal Keywords: srs ogr2ogr towgs84
Cc: Mateusz Łoskot

Description

I'm trying to translate some mapinfo-data from madagascar using a custom proj. But ogr2ogr seems to ignore the towgs84-parameters. In fact all these 4 commands produce the same results (which are wrong) by ignoring "+towgs84=-189,-242,-91,0,0,0,0":

# normal ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs" -t_srs "epsg:32738" lim_commune_aout06_01.shp lim_commune_aout06.tab

# without towgs84: ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +units=m +no_defs" -t_srs "epsg:32738" lim_commune_aout06_02.shp lim_commune_aout06.tab

# explicit proj in t_srs: ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs" -t_srs "+proj=utm +zone=38 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs" lim_commune_aout06_03.shp lim_commune_aout06.tab

# without no_defs: ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +units=m" -t_srs "epsg:32738" lim_commune_aout06_04.shp lim_commune_aout06.tab

But there should be differences. I thin kthis is a major bug because transformations is one of the main features of ogr2ogr and should work properly.

Change History (4)

comment:1 by warmerdam, 16 years ago

Priority: highnormal
Severity: majornormal
Status: newassigned

I have tried these two transformation with variations of omerc with different towgs84 values and they produce different results. This was done with the 1.4 branch (essentially GDAL 1.4.4), and PROJ.4 4.6.0beta.

warmerda@amd64[13]% testepsg -t "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +towgs84=-189,-242,-91,0,0,0,0 +units=m +no_defs" EPSG:32738 1000 1500
(1000.000000,1500.000000,0.000000) -> (-469173.771541,5019884.995944,62.549850)
warmerda@amd64[14]% testepsg -t "+proj=omerc +lat_0=-18.9 +lonc=46.437229 +alpha=18.9 +k=0.999500 +x_0=1113136.314600 +y_0=2882900.727900 +ellps=intl +towgs84=-189,-100,-91,0,0,0,0 +units=m +no_defs" EPSG:32738 1000 1500
(1000.000000,1500.000000,0.000000) -> (-469062.583780,5019956.754170,117.652885)

I can think of a few things to try and further isolate why you are getting wrong results:

  • You could try the same commands I did with the testepsg program. If you are building yourself you may need to cd into gdal/ogr and do "make testepsg" as it is not a default part of the build.
  • You could provide a shapefile with one point in it, and give the results (as reported by ogrinfo) that you were getting for the various commands and I could try to reproduce.
  • You could upgrade to GDAL 1.4.4 and see if that makes any difference.

comment:2 by warmerdam, 16 years ago

Milestone: 1.4.51.5.1

Lacking feedback, I'm pushing this on to 1.5.1. If there are fixes to be applied we can consider back porting them into 1.4.5.

comment:3 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added

comment:4 by Even Rouault, 13 years ago

Milestone: 1.8.1
Resolution: wontfix
Status: assignedclosed

No feedback from reporter. Closing

Note: See TracTickets for help on using tickets.