<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi list,</p>
<p>I am setting up a WMS server using Mapserver 7.6.2 and want to
return a html response to a GetFeatureInfo request where the
response contains the coordinates of the GFI click. The WMS
supports multiple coordinate systems, so ideally I'd like to have
the coordinates in a CRS that I can predetermine.</p>
<p>I have a test template file as follows:</p>
<pre><!-- MapServer Template -->
<p>
Map X/Y : [mapx],[mapy]<br>
Map LL : [maplon],[maplat]
</p></pre>
<p>If I configure an 'old style' TEMPLATE in the map file, directly
referencing the html template as follows:</p>
<pre>LAYER
TEMPLATE "coord_comp.html"</pre>
<p>With a GFI request specifying a CRS of EPSG:27700:</p>
<pre>...&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo
&BBOX=379766.9556955648586154,58602.32640402266406454,405538.15569556411355734,94300.79913129436317831
&CRS=EPSG:27700&WIDTH=649&HEIGHT=899&LAYERS=test&STYLES=&FORMAT=image/jpeg&QUERY_LAYERS=test
&INFO_FORMAT=text/html&I=268&J=647&FEATURE_COUNT=50
</pre>
<p></p>
<p>the output of is as follows:<br>
</p>
<p>Map X/Y : 390428.846605,68589.162768<br>
Map LL : 50.516415,-2.135015</p>
<p>When a similar requests are made specifying a CRS of EPSG:4326:</p>
<pre>...&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo
&BBOX=50.33460688675980776,-2.28814701603231718,50.84060858090575863,-1.92285769511938809
&CRS=EPSG:4326&WIDTH=649&HEIGHT=899&LAYERS=test&STYLES=&FORMAT=image/jpeg&QUERY_LAYERS=test
&INFO_FORMAT=text/html&I=298&J=579&FEATURE_COUNT=50
</pre>
<p>the output is as follows:</p>
<p>
</p>
<p>Map X/Y : 50.514437,-2.120136<br>
Map LL : [maplon],[maplat]</p>
<p>The maplat and maplon templates are not substituted.</p>
<p>Mapserver has been compiled with PROJ support and a PROJECTION
has been defined for the layer in the map file.</p>
<p>The CRS of the source data is EPSG:27700</p>
<p>I was hoping that the maplat and maplon templates would provide
me with a consistent source of coordinate information, independent
of the request CRS. Can anybody shed any light on the observed
behaviour? <br>
</p>
Thanks,<br>
<p>Andy<br>
</p>
<pre class="moz-signature" cols="72">--
Andy Harfoot
Skype: gdi_ajph
Teams: <a class="moz-txt-link-abbreviated" href="mailto:ajph@soton.ac.uk">ajph@soton.ac.uk</a>
Phone: +44 2380 590566
GeoData Institute
University of Southampton
Southampton
SO17 1BJ
<a class="moz-txt-link-abbreviated" href="http://www.geodata.soton.ac.uk">www.geodata.soton.ac.uk</a></pre>
</body>
</html>