mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
postcode/zipcode improvements, finish work on handling extratags
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
$oDB =& DB::connect(CONST_Database_DSN.($bNew?'?new_link=true':''), false);
|
||||
if (PEAR::IsError($oDB))
|
||||
{
|
||||
fail($oDB->getMessage(), 'Unable to connect to the database');
|
||||
var_dump(CONST_Database_DSN);
|
||||
var_Dump($oDB);
|
||||
fail($oDB->getMessage());
|
||||
}
|
||||
$oDB->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
$oDB->query("SET DateStyle TO 'sql,european'");
|
||||
|
||||
@@ -697,12 +697,8 @@
|
||||
$sSQL .= " length(name::text) as namelength ";
|
||||
$sSQL .= " from place_addressline join placex on (address_place_id = placex.place_id)";
|
||||
$sSQL .= " where place_addressline.place_id = $iPlaceID and (rank_address > 0 OR address_place_id = $iPlaceID)";
|
||||
// and isaddress";
|
||||
if ($sCountryCode)
|
||||
{
|
||||
$sSQL .= " and (placex.country_code IS NULL OR placex.country_code = '".$sCountryCode."' OR rank_address < 4)";
|
||||
}
|
||||
$sSQL .= " order by cached_rank_address desc,fromarea desc,distance asc,rank_search desc,namelength desc";
|
||||
$sSQL .= " order by cached_rank_address desc,isaddress desc,fromarea desc,distance asc,rank_search desc,namelength
|
||||
desc";
|
||||
//var_dump($sSQL);
|
||||
$aAddressLines = $oDB->getAll($sSQL);
|
||||
if (PEAR::IsError($aAddressLines))
|
||||
|
||||
@@ -31,8 +31,8 @@ body {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
<script src="OpenLayers.js"></script>
|
||||
<script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
|
||||
<script src="js/OpenLayers.js"></script>
|
||||
<script src="js/OpenStreetMap.js"></script>
|
||||
<script src="prototype-1.6.0.3.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -111,6 +111,12 @@ foreach($aPolyPoints as $aPolyPoint)
|
||||
echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
|
||||
$sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
|
||||
if ($sOSMType) echo ' <div>OSM: <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPointDetails['osm_id'].'">'.$aPointDetails['osm_id'].'</a></span></div>';
|
||||
echo ' <div>Extra Tags: ';
|
||||
foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
|
||||
{
|
||||
echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
|
||||
}
|
||||
echo ' </div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<h2>Address</h2>';
|
||||
|
||||
Reference in New Issue
Block a user