[MapProxy] Reprojecting to EPSG:4326 cuts data at prime meridian.

Marc Monnerat procrastinatio at gmail.com
Wed Sep 9 07:24:17 PDT 2015


Hello,

The source data BBOX is, in EPSG:21781,    [420000, 30000, 900000, 350000].
The global BBOX (-180.0, -90.0, 180.0, 90.0) is way off the domain of
validity of EPSG:21781 [1] , which cause troubles.

The global source BBOX transformed into the local EPSG:21781 using
*mapproxy.srs.**transform_bbox_to* is wrong, it should be something like
420'000 (or any valid bound of the projection [1])  instead of 600'000 (the
prime meridian).

from mapproxy.srs import *

 ['%.3f' % x for x in  SRS(4326).transform_bbox_to(SRS(21781), (*-180.0*,
-90.0, 180.0, 90.0))]
['*600096.399*', '-5125675.606', '8172104.858', '19478127.863']

The cause is the underlying *libproj*:

$ cs2cs -f "%.10f" +init=epsg:4326 +to +init=epsg:21781
7.6 46.8
612318.6219500237       183216.7465388897 -49.8658740725
*-180.0* -90
*600097.0176702371*       -5125675.6478488399 1078.7329751570



Marc


[1] According to EPSG, the  WGS84 bounds is 5.96 45.8210.49 47.81 or
as projected
bounds: 485071.54 75346.36 828515.78 299941.84


2015-09-01 16:53 GMT+02:00 Marc Monnerat <procrastinatio at gmail.com>:

> Hello,
>
>  My goal is to reproject a WMTS source in EPSG:21781 into EPSG:4326, as a
> WMTS service (or eventually a WMS service). This is working fine for
> projection like EPSG:2056 (LV95), EPSG:3857 (webmercator) or EPSG:4258
> (ETRS89). But using EPSG:4326, I get some strange result.
>
> Checking the result in the MapProxy Demo page, using the EPSG:4326 ans the
> WMS service:
>
>
> http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231
>
> we find that there is *no* data West of the prime meridian of (city of
> Bern, if you know Switzerland, 600'000m easting or about 7.5° West in
> WGS84).
>
> The same layer, using the WMTS service, displays the same problem:
>
> http://codepen.io/procrastinatio/pen/XmWEZL?editors=001
>
> The prime meridian is one of the vertical purple line.
>
> In comparison, using EPSG:4258 (ETRS89), which is "almost" identical to
> EPSG:4326, data are displayed correctly both side of the meridian, as shown
> in the demo
>
>
> http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4258&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231
>
> We are using MapProxy Version 1.8.0 and the configuration file is
> https://raw.githubusercontent.com/geoadmin/mf-chsdi3/master/mapproxy/mapproxy.yaml
> (very long).
>
>
> If anyone has a hint, I would be glad.
>
>
> Thank you in advance!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20150909/480f0712/attachment.html>


More information about the MapProxy mailing list