mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
avoid matching of error message twice
This commit is contained in:
@@ -144,35 +144,33 @@ body {
|
|||||||
<p>This object has an invalid geometry.</p>
|
<p>This object has an invalid geometry.</p>
|
||||||
<p><b>Details:</b> <?php
|
<p><b>Details:</b> <?php
|
||||||
|
|
||||||
$sVal = $aPointDetails['errormessage'];
|
$sVal = $aPointDetails['errormessage']?$aPointDetails['errormessage']:' ';
|
||||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||||
$sOSMID = $aPointDetails['osm_id'];
|
$sOSMID = $aPointDetails['osm_id'];
|
||||||
|
|
||||||
$bHaveLatLng = false;
|
if (isset($aPointDetails['error_x'])
|
||||||
if (preg_match('/Self-intersection\\[([0-9.\\-]+) ([0-9.\\-]+)\\]/',$sVal,$aMatch))
|
|
||||||
{
|
{
|
||||||
$sLat = $aMatch[2];
|
$sLat = $aPointDetails['error_y'];
|
||||||
$sLon = $aMatch[1];
|
$sLon = $aPointDetails['error_x'];
|
||||||
$bHaveLatLng = true;
|
echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".$sVal."</a>";
|
||||||
echo "<a href=\"http://www.openstreetmap.org/?lat=".$sLat."&lon=".$sLon."&zoom=18&layers=M&".$sOSMType."=".$sOSMID."\">".($sVal?$sVal:' ')."</a>";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo ($sVal?$sVal:' ');
|
echo $sVal;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<p><b>Edit:</b> in <?php
|
<p><b>Edit:</b> in <?php
|
||||||
if ($bHaveLatLng)
|
if (isset($aPointDetails['error_x'])
|
||||||
{
|
{
|
||||||
$fWidth = 0.0002;
|
$fWidth = 0.0002;
|
||||||
echo " <a href=\"http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth)."\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";
|
echo " <a href=\"http://localhost:8111/load_and_zoom?left=".($sLon-$fWidth)."&right=".($sLon+$fWidth)."&top=".($sLat+$fWidth)."&bottom=".($sLat-$fWidth)."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
|
||||||
echo " | <a href=\"http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth)."\" target=\"potlatch2\">Potlatch 2</a>";
|
echo " | <a href=\"http://www.openstreetmap.org/edit?editor=potlatch2&bbox=".($sLon-$fWidth).",".($sLat-$fWidth).",".($sLon+$fWidth).",".($sLat+$fWidth)."\" target=\"potlatch2\">Potlatch 2</a>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo " <a href=\"http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/".$sOSMType.'/'.$sOSMID."/full\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";
|
echo " <a href=\"http://localhost:8111/import?url=http://www.openstreetmap.org/api/0.6/".$sOSMType.'/'.$sOSMID."/full\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
|
||||||
// Should be better to load by object id - but this doesn't seem to zoom correctly
|
// Should be better to load by object id - but this doesn't seem to zoom correctly
|
||||||
//echo " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aPointDetails['osm_type']).$sOSMID."\" target=\"josm\">Remote Controll (JOSM / Merkaartor)</a>";
|
//echo " <a href=\"http://localhost:8111/load_object?new_layer=true&objects=".strtolower($aPointDetails['osm_type']).$sOSMID."\" target=\"josm\">Remote Control (JOSM / Merkaartor)</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
?></p>
|
?></p>
|
||||||
|
|||||||
Reference in New Issue
Block a user