<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Hi Seth,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Thanks for checking that, I see what
      you mean. I'll submit a pull request to correct the logic.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Cheers,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Andy<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 19/10/2023 16:26, Seth G wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:b3cce22d-7492-45c4-aef6-ecb2f687d8d7@app.fastmail.com">
      
      <title></title>
      <style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
      <div style="padding-bottom: 10px; padding-top: 5px;">
        <div style="padding:12px; border:1px solid #8D3970; background-color:#F7F9FA; color:#8D3970; font-size:14px; line-height:22px; font-family: Calibri, Arial, Helvetica, sans-serif;">
          <strong>CAUTION:</strong> This e-mail originated outside the
          University of Southampton.
        </div>
      </div>
      <div>
        <div>Hi,<br>
        </div>
        <div><br>
        </div>
        <div>This seems like a bug - there is a check to see if the Map
          projection is a geographic coordinate system [1], and if it is
          then it skips all the [maplon], [maplat], [minlon] etc.
          substitutions. If it is in another projection then the point
          and extent are reprojected to latlon and included in the
          template. <br>
        </div>
        <div><br>
        </div>
        <div>Seth<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>[1] <a href="https://github.com/MapServer/MapServer/blob/main/src/maptemplate.c#L4273" moz-do-not-send="true" class="moz-txt-link-freetext">
https://github.com/MapServer/MapServer/blob/main/src/maptemplate.c#L4273</a></div>
        <div><br>
        </div>
        <div id="sig62266145">
          <div class="signature">--<br>
          </div>
          <div class="signature">web:<a href="https://geographika.net" moz-do-not-send="true" class="moz-txt-link-freetext">https://geographika.net</a>
            & <a href="https://mapserverstudio.net" moz-do-not-send="true" class="moz-txt-link-freetext">https://mapserverstudio.net</a><br>
          </div>
          <div class="signature">twitter: @geographika<br>
          </div>
        </div>
        <div><br>
        </div>
        <div>On Thu, Oct 19, 2023, at 3:50 PM, Andrew Harfoot via
          MapServer-users wrote:<br>
        </div>
        <blockquote type="cite" id="qt" style="">
          <p>Hi list,<br>
          </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.<br>
          </p>
          <p>I have a test template file as follows:<br>
          </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:<br>
          </p>
          <pre>LAYER
  TEMPLATE "coord_comp.html"
</pre>
          <p>With a GFI request specifying a CRS of EPSG:27700:<br>
          </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><br>
          </p>
          <p>the output of is as follows:<br>
          </p>
          <div>Map X/Y : 390428.846605,68589.162768<br>
          </div>
          <div>Map LL : 50.516415,-2.135015<br>
          </div>
          <p>When a similar requests are made specifying a CRS of
            EPSG:4326:<br>
          </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:<br>
          </p>
          <p><br>
          </p>
          <div>Map X/Y : 50.514437,-2.120136<br>
          </div>
          <div>Map LL : [maplon],[maplat]<br>
          </div>
          <p>The maplat and maplon templates are not substituted.<br>
          </p>
          <p>Mapserver has been compiled with PROJ support and a
            PROJECTION has been defined for the layer in the map file.<br>
          </p>
          <p>The CRS of the source data is EPSG:27700<br>
          </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>
          <div>Thanks,<br>
          </div>
          <p>Andy<br>
          </p>
          <pre class="qt-moz-signature" cols="72">-- 
Andy Harfoot

Skype: gdi_ajph
Teams: <a class="qt-moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:ajph@soton.ac.uk" moz-do-not-send="true">ajph@soton.ac.uk</a>
Phone: +44 2380 590566

GeoData Institute
University of Southampton
Southampton
SO17 1BJ

<a class="qt-moz-txt-link-abbreviated" href="http://www.geodata.soton.ac.uk" moz-do-not-send="true">www.geodata.soton.ac.uk</a>
</pre>
          <div>_______________________________________________<br>
          </div>
          <div>MapServer-users mailing list<br>
          </div>
          <div><a href="mailto:MapServer-users@lists.osgeo.org" moz-do-not-send="true" class="moz-txt-link-freetext">MapServer-users@lists.osgeo.org</a><br>
          </div>
          <div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
          </div>
          <div><br>
          </div>
        </blockquote>
        <div><br>
        </div>
      </div>
    </blockquote>
    <p><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>