Bug report #12945

Updated by Jürgen Fischer about 6 years ago

The proj4 text for the oblique mercator projection GDBD2009 (EPSG 5247) is missing the parameter @+no_uoff@ in srs.db. The @+no_uoff@ was also missing in earlier versions of GDAL and SpatiaLite but now seems to be fixed in both. I can get correct behaviour for this CRS by creating a custom CRS in the QGIS GUI with @+no_uoff@ added.



This seems to be related to an earlier bug (#1196) - it sounded like that was fixable by regenerating srs.db using crssync (?). Is this something I can / should do myself? I have been building QGIS from source, rather than using the Fedora-distributed RPM.



Here is the proj4 text in QGIS version 2.9.0-Master, code revision aa6db0e

<pre>

$ echo 'select srid, description, parameters from tbl_srs where srid=5247;' | sqlite3 resources/srs.db

5247|GDBD2009 / Brunei BRSO|+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs

</pre>

and here it is in GDAL:

<pre>

gdalsrsinfo --version

GDAL 2.1.0dev, released 2015/99/99

$ gdalsrsinfo 'EPSG:5247'



PROJ.4 : '+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '

</pre>

and in SpatiaLite 4.2.0:

<pre>

sqlite> .load mod_spatialite

sqlite> select spatialite_version();

4.2.0

sqlite> select InitSpatialMetaData();

1

sqlite> select srid, ref_sys_name, proj4text from spatial_ref_sys where srid=5247;

5247|GDBD2009 / Brunei BRSO|+proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

</pre>



cs2cs also works correctly with this CRS in PROJ.4 4.8.0 (PROJ.4 claims that +no_uoff is not used, but it is):

<pre>

$ echo 114.352966 4.359395 | cs2cs -v +init=epsg:4326 +to +init=epsg:5247

# ---- From Coordinate System ----

#Lat/long (Geodetic alias)

#

# +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84

# +towgs84=0,0,0

# ---- To Coordinate System ----

#Oblique Mercator

# Cyl, Sph&Ell no_rot

# alpha= [gamma=] [no_off] lonc= or

# lon_1= lat_1= lon_2= lat_2=

# +init=epsg:5247 +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984

# +x_0=0 +y_0=0 +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs

#--- following specified but NOT used

# +no_uoff

518581.10 482422.80 0.00

</pre>



Tested on QGIS version 2.9.0-Master, code revision aa6db0e, compiled against GDAL/OGR 2.1.0dev, running against GDAL/OGR 2.1.0dev, compiled against GEOS 3.4.2-CAPI-1.8.2, running against GEOS 3.4.2-CAPI-1.8.2 r3921, PROJ.4 Version 480

Back