X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b1e10bce0d0b0cae4f401305608154c898311755..8d221e2c8263133b9784803dc7f61701ae872254:/website/details.php diff --git a/website/details.php b/website/details.php index a4cb8b96..ff90cd98 100755 --- a/website/details.php +++ b/website/details.php @@ -43,7 +43,7 @@ //$oDB->query($sSQL); // Get the details for this point - $sSQL = "select place_id, osm_type, osm_id, class, type, name, admin_level, housenumber, street, isin, postcode, country_code, importance,"; + $sSQL = "select place_id, osm_type, osm_id, class, type, name, admin_level, housenumber, street, isin, postcode, country_code, importance, wikipedia,"; $sSQL .= " parent_place_id, rank_address, rank_search, get_searchrank_label(rank_search) as rank_search_label, get_name_by_language(name,$sLanguagePrefArraySQL) as localname, "; $sSQL .= " ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea,ST_GeometryType(geometry) as geotype, ST_Y(ST_Centroid(geometry)) as lat,ST_X(ST_Centroid(geometry)) as lon "; $sSQL .= " from placex where place_id = $iPlaceID"; @@ -109,12 +109,19 @@ // Address $aAddressLines = getAddressDetails($oDB, $sLanguagePrefArraySQL, $iPlaceID, $aPointDetails['country_code'], true); + // Linked places + $sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, st_distance(geometry, placegeometry) as distance, "; + $sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength "; + $sSQL .= " from placex, (select geometry as placegeometry from placex where place_id = $iPlaceID) as x"; + $sSQL .= " where linked_place_id = $iPlaceID"; + $sSQL .= " order by rank_address asc,rank_search asc,get_name_by_language(name,$sLanguagePrefArraySQL),housenumber"; + $aLinkedLines = $oDB->getAll($sSQL); + // All places this is an imediate parent of $sSQL = "select placex.place_id, osm_type, osm_id, class, type, housenumber, admin_level, rank_address, ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea, st_distance(geometry, placegeometry) as distance, "; $sSQL .= " get_name_by_language(name,$sLanguagePrefArraySQL) as localname, length(name::text) as namelength "; $sSQL .= " from placex, (select geometry as placegeometry from placex where place_id = $iPlaceID) as x"; $sSQL .= " where parent_place_id = $iPlaceID"; -// $sSQL .= " and type != 'postcode'"; $sSQL .= " order by rank_address asc,rank_search asc,get_name_by_language(name,$sLanguagePrefArraySQL),housenumber"; $aParentOfLines = $oDB->getAll($sSQL);