[Mapbender-users] Problems with the handling of some OWS in Mapbender2 - solved

Armin Retterath armin.retterath at lvermgeo.rlp.de
Wed Jul 2 07:03:39 PDT 2014

Hello together,

in some Mapbender implementations it is not possible to register 
services, that have a global extent like -180,-90,180,90.
It was possible without any problems under postgis 1.3.1 and proj4 4.5 
(e.g. debian lenny), but when updating to postgis 1.5.1 in conjunction 
with proj4.7 (e.g. debian wheezy) it  came to problems when nadgrids are 
used to make precise coordinate transformations.

The problem was the definition of the nadgrids in the epsg file and in 
the postgis spatial_ref_sys table. Before proj4.6, someone was able to 
define following proj4text:

+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +nadgrids=BETA2007.gsb

When st_transform was invoked, the transformation was done without 
problems. In the newer version an error will occur, if the point that 
should be transformed is not in the bbox of the nadgrid itself. The 
spatial selects will throw an error and mapbender makes trouble ;-) .

If you update to a newer postgis/proj version, you should set the @ sign 
before the .gsb file and give a null value for the case, that the gsb 
file is not used (e.g. the point is outside the bbox of the grid or the 
grid file was not found).

+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@BETA2007.gsb,null

After this you will not longer will have trouble with your postgis and 
mapbender ;-) .

SQL to update the proj4text in case of german-wide BETA2007 
transformations (you have to download the BETA2007.gsb to the proj 
folder before):

UPDATE spatial_ref_sys set proj4text = '+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@BETA2007.gsb,null' WHERE srid = 31466;

UPDATE spatial_ref_sys set proj4text = '+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@BETA2007.gsb,null' WHERE srid = 31467;

UPDATE spatial_ref_sys set proj4text = '+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@BETA2007.gsb,null' WHERE srid = 31468;

UPDATE spatial_ref_sys set proj4text = '+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +nadgrids=@BETA2007.gsb,null' WHERE srid = 31469;

UPDATE spatial_ref_sys set proj4text = '+proj=utm +zone=32 +ellps=GRS80 +units=m +datum=WGS84' WHERE srid = 25832;

Hope that helps a little bit


Zentrale Stelle Geodateninfrastruktur

Ferdinand-Sauerbruch-Straße 15
56073 Koblenz

armin.retterath at lvermgeo.rlp.de

More information about the Mapbender_users mailing list