[fusion-commits] r3066 - trunk/layers/MapGuide/php
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Nov 5 23:55:51 PST 2026
Author: jng
Date: 2026-11-05 23:55:51 -0800 (Thu, 05 Nov 2026)
New Revision: 3066
Modified:
trunk/layers/MapGuide/php/Measure.php
Log:
Apply MapGuide ticket 2891 measurement fix
Modified: trunk/layers/MapGuide/php/Measure.php
===================================================================
--- trunk/layers/MapGuide/php/Measure.php 2025-05-05 13:44:02 UTC (rev 3065)
+++ trunk/layers/MapGuide/php/Measure.php 2026-11-06 07:55:51 UTC (rev 3066)
@@ -55,12 +55,11 @@
$srsFactory = new MgCoordinateSystemFactory();
$srs = GetMapSRS($map);
$srsMap = $srsFactory->Create($srs);
- $srsType = $srsMap->GetType();
- if ($srsType == MgCoordinateSystemType::Geographic) {
- $distance = $srsMap->MeasureGreatCircleDistance($x1, $y1, $x2, $y2);
- } else {
- $distance = $srsMap->MeasureEuclideanDistance($x1, $y1, $x2, $y2);
- }
+ // The measurement rule -- planar for a locally representative grid, ellipsoidal for a world
+ // projection such as EPSG:3857 -- lives in MgCoordinateSystemMeasure, so this agrees with the
+ // MapAgent geo.distance operation by construction (mapguide #2891). The four-double overload
+ // is GetDistanceSimple in PHP (monkey_patch.i).
+ $distance = $srsMap->GetMeasure()->GetDistanceSimple($x1, $y1, $x2, $y2);
$distance = $srsMap->ConvertCoordinateSystemUnitsToMeters($distance);
header('Content-type: application/json');
header('X-JSON: true');
More information about the fusion-commits
mailing list