mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 05:18:00 +00:00
Add options to output polygon in various formats: polygon_geojson=1&polygon_svg=1&polygon_kml=1&polygon_text=1 They can be all used at the same time if prefered. Where format and polygon type are compatible output is as native type e.g. format=json&polygon_geojson=1
This commit is contained in:
@@ -49,6 +49,26 @@
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
if (isset($aResult['asgeojson']))
|
||||
{
|
||||
$aPlace['geojson'] = json_decode($aResult['asgeojson']);
|
||||
}
|
||||
|
||||
if (isset($aResult['assvg']))
|
||||
{
|
||||
$aPlace['svg'] = $aResult['assvg'];
|
||||
}
|
||||
|
||||
if (isset($aResult['astext']))
|
||||
{
|
||||
$aPlace['geotext'] = $aResult['astext'];
|
||||
}
|
||||
|
||||
if (isset($aResult['askml']))
|
||||
{
|
||||
$aPlace['geokml'] = $aResult['askml'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,27 @@
|
||||
$aPlace['address'] = $aPointDetails['address'];
|
||||
}
|
||||
|
||||
if (isset($aResult['asgeojson']))
|
||||
{
|
||||
$aPlace['geojson'] = json_decode($aResult['asgeojson']);
|
||||
}
|
||||
|
||||
if (isset($aResult['assvg']))
|
||||
{
|
||||
$aPlace['svg'] = $aResult['assvg'];
|
||||
}
|
||||
|
||||
if (isset($aResult['astext']))
|
||||
{
|
||||
$aPlace['geotext'] = $aResult['astext'];
|
||||
}
|
||||
|
||||
if (isset($aResult['askml']))
|
||||
{
|
||||
$aPlace['geokml'] = $aResult['askml'];
|
||||
}
|
||||
|
||||
$aFilteredPlaces[] = $aPlace;
|
||||
}
|
||||
|
||||
javascript_renderData($aFilteredPlaces);
|
||||
javascript_renderData($aFilteredPlaces, array('geojson'));
|
||||
|
||||
@@ -50,6 +50,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aResult['asgeojson']))
|
||||
{
|
||||
echo ' geojson=\'';
|
||||
echo $aResult['asgeojson'];
|
||||
echo '\'';
|
||||
}
|
||||
|
||||
if (isset($aResult['assvg']))
|
||||
{
|
||||
echo ' geosvg=\'';
|
||||
echo $aResult['assvg'];
|
||||
echo '\'';
|
||||
}
|
||||
|
||||
if (isset($aResult['astext']))
|
||||
{
|
||||
echo ' geotext=\'';
|
||||
echo $aResult['astext'];
|
||||
echo '\'';
|
||||
}
|
||||
|
||||
if (isset($aResult['zoom']))
|
||||
{
|
||||
echo " zoom='".$aResult['zoom']."'";
|
||||
@@ -66,9 +87,20 @@
|
||||
echo " icon='".htmlspecialchars($aResult['icon'], ENT_QUOTES)."'";
|
||||
}
|
||||
|
||||
if (isset($aResult['address']))
|
||||
if (isset($aResult['address']) || isset($aResult['askml']))
|
||||
{
|
||||
echo ">";
|
||||
}
|
||||
|
||||
if (isset($aResult['askml']))
|
||||
{
|
||||
echo "\n";
|
||||
echo $aResult['askml'];
|
||||
}
|
||||
|
||||
if (isset($aResult['address']))
|
||||
{
|
||||
echo "\n";
|
||||
foreach($aResult['address'] as $sKey => $sValue)
|
||||
{
|
||||
$sKey = str_replace(' ','_',$sKey);
|
||||
@@ -76,7 +108,10 @@
|
||||
echo htmlspecialchars($sValue);
|
||||
echo "</$sKey>";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aResult['address']) || isset($aResult['askml']))
|
||||
{
|
||||
echo "</place>";
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user