]> git.openstreetmap.org Git - nominatim.git/commitdiff
make selfintersections a link
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 7 Nov 2012 23:46:50 +0000 (23:46 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 7 Nov 2012 23:46:50 +0000 (23:46 +0000)
lib/template/details-error-html.php

index ee23e661335e84bab38779b7b3e2eb14ddffbb41..b93d649542d9fbbf5c832eaae60ef889b8ccfe5e 100644 (file)
@@ -142,7 +142,24 @@ body {
 ?>
 
     <p>This object has an invalid geometry.</p>
-    <p><b>Details:</b> <?php echo $aPointDetails['errormessage'];?></p>
+    <p><b>Details:</b> <?php
+
+$sVal = $aPointDetails['errormessage'];
+$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
+$sOSMID = $aPointDetails['osm_id'];
+
+if (preg_match('/Self-intersection\\[([0-9.\\-]+) ([0-9.\\-]+)\\]/',$sVal,$aMatch))
+{
+       $sLat = $aMatch[2];
+       $sLon = $aMatch[1];
+       echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".($sVal?$sVal:'&nbsp;')."</a>";
+}
+else
+{
+       echo ($sVal?$sVal:'&nbsp;');
+}
+
+?></p>
 
   </body>
 </html>