<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Tamas,</p>
    <p>(I'd appreciate if RFCs could also be kept proportional (=small)
      in length to the change being discussed to remain accessible to
      humans that don't use LLMs)</p>
    <p>- I'm wondering if we really need the Cartesian behavior to be
      preserved. Does it make sense at all ? if not this could save us
      and users from handling an extra configuration parameter. I'd say
      if the project has a CRS use the geodetic scale, otherwise
      fallback to Cartesian method. </p>
    <p>- I'm not sure it makes sense to correlate the sample position
      with the location of the scale bar. Looking at QGIS scalebar in
      layout, it has the following options "average top , middle and
      bottom scales", "top of map", "middle of map", "bottom of map",
      "always at the equator".   We don't necessarily need to offer all
      that complexity, so perhaps just middle of the map ?</p>
    <p>- the geodesic mode, if taking into account distances along the X
      axis, as I see in
<a class="moz-txt-link-freetext" href="https://github.com/MapServer/MapServer/pull/7507/changes#diff-968c7ca959d226116368f37b62faf245fff8049e3e29fd03ab6914766d61d3d5R238">https://github.com/MapServer/MapServer/pull/7507/changes#diff-968c7ca959d226116368f37b62faf245fff8049e3e29fd03ab6914766d61d3d5R238</a> doesn't
      always make sense because the scale, even when mapping locally can
      be very different along the horizontal and vertical axis.
      Conformal projections (Mercator, Transverse Mercator, LCC, etc.)
      have indeed identical scale in both directions, but if you use
      let's say Equal Earth that can be very different. Maybe we should
      use the geometric average sqrt ( scale_along_x * scale_along_y ) 
      which should yield at least something better if doing area
      measurement, which will also often be the Cartesian distance. If
      we don't do that, we should be very clear in the documentation
      that the value only makes sense in the horizontal direction. </p>
    <p>Ex: Equal Earth, 10 km in projected distance along X and Y:</p>
    <p>$ echo  0 7700000 | gdaltransform  -s_srs +proj=eqearth  -t_srs
      <a class="moz-txt-link-freetext" href="EPSG:4326">EPSG:4326</a><br>
      0 70.1915580220322 0<br>
      $ echo  0 7710000 | gdaltransform -s_srs +proj=eqearth  -t_srs
      <a class="moz-txt-link-freetext" href="EPSG:4326">EPSG:4326</a><br>
      0 70.3458420298602 0<br>
      $ echo 10000 7700000 | gdaltransform -s_srs +proj=eqearth  -t_srs
      <a class="moz-txt-link-freetext" href="EPSG:4326">EPSG:4326</a><br>
      0.153998673719061 70.1915580220322 0<br>
      $ echo 70.1915580220322 0 70.3458420298602 0 | geod -I
      +ellps=WGS84<br>
      0d    -180d    17212.757<br>
      $ echo 70.1915580220322 0 70.1915580220322 0.153998673719061  |
      geod -I +ellps=WGS84<br>
      89d55'39.204"    -89d55'39.204"    5826.666</p>
    <p>So the 10 km have become 17.2 along X and 5.83 along Y.    But
      sqrt(17.2 * 5.83) = 10.0 km</p>
    <p>Even</p>
    <div class="moz-cite-prefix">Le 16/05/2026 à 19:38, Tamas Szekeres
      via MapServer-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CACALY+QcCBfPF2C1dTStigDcCZ1_1XxTV1X6O=txpvMy9sk_Kg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr"><span style="color:rgb(0,0,0)">Hi Devs,</span><br
          style="color:rgb(0,0,0)">
        <br style="color:rgb(0,0,0)">
        <span style="color:rgb(0,0,0)">I've prepared an RFC to </span>add
        explicit measurement modes to the MapServer<br>
        SCALEBAR object. The goal is to preserve the current Cartesian
        scalebar<br>
        behavior by default while allowing users to request local
        geodesic ground<br>
        distance measurement for projections where projected map units
        are not equal to ground distance.<br>
        The main motivating case is Web Mercator / <a class="moz-txt-link-freetext" href="EPSG:3857">EPSG:3857</a>. In that
        projection, coordinates are expressed in meters, but projected
        meters increasingly differ from local ground meters away from
        the equator. The current scalebar implementation treats
        projected coordinate units as a flat Cartesian plane, so metric
        scalebars can overstate local ground distance in <a class="moz-txt-link-freetext" href="EPSG:3857">EPSG:3857</a> and
        similar projections.
        <div><br>
        </div>
        <div>
          <div><span style="color:rgb(0,0,0)">Links:</span><br
              style="color:rgb(0,0,0)">
            <br style="color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0)">- RFC text: </span><a
href="https://mapserver.org/development/rfc/ms-rfc-142.html"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://mapserver.org/development/rfc/ms-rfc-142.html</a><br
              style="color:rgb(0,0,0)">
            <br style="color:rgb(0,0,0)">
            <span style="color:rgb(0,0,0)">- Candidate implementation: </span><a
              href="https://github.com/MapServer/MapServer/pull/7507"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/MapServer/MapServer/pull/7507</a><font
              color="#888888"><br>
            </font><br>
            - Issue targeted:  <a
              href="https://github.com/MapServer/MapServer/issues/7397"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/MapServer/MapServer/issues/7397</a><br>
            <br>
            Tamas</div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
MapServer-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:MapServer-dev@lists.osgeo.org">MapServer-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a>
</pre>
    </blockquote>
    <div class="moz-signature">-- <br>
      <a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
      My software is free, but my time generally not.</div>
  </body>
</html>