postcode/zipcode improvements, finish work on handling extratags

This commit is contained in:
Brian Quinion
2010-12-07 13:41:02 +00:00
parent 491f5961e1
commit 631e8d09ab
11 changed files with 378 additions and 121 deletions

View File

@@ -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'");

View File

@@ -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))

View File

@@ -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>';