]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/details.php
Merge pull request #671 from mtmail/html-view-use-geojson-geometries
[nominatim.git] / website / details.php
index 0b21123dd2f83c97ec234ed01d73eea34f97b92d..0025a8ba212e73e7dfffe8d0a72bd370009c122b 100755 (executable)
@@ -69,6 +69,11 @@ if (CONST_Use_US_Tiger_Data) {
     if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
 }
 
+// interpolated house numbers
+$iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_osmline WHERE place_id = '.$iPlaceID));
+if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
+
+
 if (CONST_Use_Aux_Location_data) {
     $iParentPlaceID = chksql($oDB->getOne('SELECT parent_place_id FROM location_property_aux WHERE place_id = '.$iPlaceID));
     if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
@@ -94,10 +99,10 @@ $sSQL .= "    CASE ";
 $sSQL .= "       WHEN importance = 0 OR importance IS NULL THEN 0.75-(rank_search::float/40) ";
 $sSQL .= "       ELSE importance ";
 $sSQL .= "       END as calculated_importance, ";
-$sSQL .= "    ST_AsText(CASE ";
+$sSQL .= "    ST_AsGeoJSON(CASE ";
 $sSQL .= "                WHEN ST_NPoints(geometry) > 5000 THEN ST_SimplifyPreserveTopology(geometry, 0.0001) ";
 $sSQL .= "                ELSE geometry ";
-$sSQL .= "                END) as outlinestring";
+$sSQL .= "                END) as asgeojson";
 $sSQL .= " FROM placex ";
 $sSQL .= " WHERE place_id = $iPlaceID";