<div dir="ltr">Hello,<div><br></div><div>The source data BBOX is, in EPSG:21781, <span style="color:rgb(0,0,0)"> [420000, 30000, 900000, 350000]. The global BBOX </span><font color="#000000">(-180.0, -90.0, 180.0, 90.0) is way off the domain of validity of EPSG:21781 [1] , which cause troubles.</font></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">The global source BBOX transformed into the local EPSG:21781 using <font face="monospace, monospace"><b>mapproxy.srs.</b></font></span><span style="color:rgb(0,0,0)"><font face="monospace, monospace"><b>transform_bbox_to</b></font> is wrong, it should be something like 420'000 (or any valid bound of the projection [1]) instead of 600'000 (the prime meridian).</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><div style=""><font color="#000000" face="monospace, monospace">from mapproxy.srs import *<br></font></div><div style=""><font color="#000000" face="monospace, monospace"><br></font></div><div style=""><font face="monospace, monospace"><font color="#000000"> ['%.3f' % x for x in SRS(4326).transform_bbox_to(SRS(21781), (</font><b><font color="#ff9900">-180.0</font></b><font color="#000000">, -90.0, 180.0, 90.0))]</font></font></div><div style=""><font face="monospace, monospace"><font color="#000000">['</font><b><font color="#ff9900">600096.399</font></b><font color="#000000">', '-5125675.606', '8172104.858', '19478127.863']</font></font></div></div><div><font color="#000000"><br></font></div><div><font color="#000000">The cause is the underlying <i>libproj</i>:</font></div><div><font color="#000000"><br></font></div><div><div style="color:rgb(0,0,0)">$ cs2cs -f "%.10f" +init=epsg:4326 +to +init=epsg:21781</div><div style="color:rgb(0,0,0)">7.6 46.8<br></div><div style="color:rgb(0,0,0)">612318.6219500237 183216.7465388897 -49.8658740725</div><div><b><font color="#ff9900">-180.0</font></b><font color="#000000"> -90</font></div><div><font color="#ff9900"><b>600097.0176702371</b> </font><span style="color:rgb(0,0,0)"> -5125675.6478488399 1078.7329751570</span></div></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Marc<br></font><div><br></div><div><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">[1] According to EPSG, the <span style="line-height:18px">WGS84 bounds is </span><span style="line-height:18px">5.96 45.82</span><span style="line-height:18px">10.49 47.81 or as p</span><span style="line-height:18px">rojected bounds: </span><span style="line-height:18px">485071.54 75346.36 </span><span style="line-height:18px">828515.78 299941.84</span></font></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-01 16:53 GMT+02:00 Marc Monnerat <span dir="ltr"><<a href="mailto:procrastinatio@gmail.com" target="_blank">procrastinatio@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p><span lang="FR-CH">Hello,</span></p>
<p><span lang="FR-CH"> </span>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.</p><p></p>
<p>Checking the result in the MapProxy Demo page, using the
EPSG:4326 ans the WMS service:</p><p></p>
<p><a href="http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231" target="_blank">http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4326&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231</a></p><p></p>
<p>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).</p><p></p>
<p>The same layer, using the WMTS service, displays the same
problem:<br></p><p></p>
<p><a href="http://codepen.io/procrastinatio/pen/XmWEZL?editors=001" target="_blank">http://codepen.io/procrastinatio/pen/XmWEZL?editors=001</a></p><p></p>
<p>The prime meridian is one of the vertical purple line.</p><p></p>
<p>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</p><p></p>
<p><a href="http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4258&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231" target="_blank">http://mf-chsdi3.dev.bgdi.ch/mom_fix_1594/mapproxy/demo/?srs=EPSG%3A4258&format=image%2Fpng&wms_layer=ch.swisstopo.zeitreihen_20031231</a><br></p><p></p>
<p>We are using MapProxy Version 1.8.0 and the configuration
file is <a href="https://raw.githubusercontent.com/geoadmin/mf-chsdi3/master/mapproxy/mapproxy.yaml" target="_blank">https://raw.githubusercontent.com/geoadmin/mf-chsdi3/master/mapproxy/mapproxy.yaml</a>
(very long).</p><p><br></p><p></p>
<p>If anyone has a hint, I would be glad.</p><p><br></p><p></p>
<p>Thank you in advance!<br></p><p></p>
</div>
</blockquote></div><br><br clear="all"><div><br></div><div class="gmail_signature"><div></div></div>
</div></div>