2 header("content-type: text/html; charset=UTF-8");
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml">
7 <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
8 <link href="css/details.css" rel="stylesheet" type="text/css" />
9 <script src="js/OpenLayers.js" type="text/javascript"></script>
10 <script src="js/tiles.js" type="text/javascript"></script>
11 <script type="text/javascript">
16 map = new OpenLayers.Map ("map", {
18 new OpenLayers.Control.Permalink(),
19 new OpenLayers.Control.Navigation(),
20 new OpenLayers.Control.PanZoomBar(),
21 new OpenLayers.Control.MousePosition(),
22 new OpenLayers.Control.Attribution()],
23 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
24 maxResolution: 156543.0399,
27 projection: new OpenLayers.Projection("EPSG:900913"),
28 displayProjection: new OpenLayers.Projection("EPSG:4326")
30 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
32 var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
33 layer_style.fillOpacity = 0.2;
34 layer_style.graphicOpacity = 0.2;
36 vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
37 map.addLayer(vectorLayer);
39 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
40 var proj_map = map.getProjectionObject();
42 freader = new OpenLayers.Format.WKT({
43 'internalProjection': proj_map,
44 'externalProjection': proj_EPSG4326
47 var feature = freader.read('<?php echo $aPointDetails['outlinestring'];?>');
48 var featureCentre = freader.read('POINT(<?php echo $aPointDetails['lon'];?> <?php echo $aPointDetails['lat'];?>)');
50 map.zoomToExtent(feature.geometry.getBounds());
52 strokeColor: "#75ADFF",
54 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
60 <?php if ($aPointDetails['isarea']=='t') {?>
61 featureCentre.style = {
62 strokeColor: "#008800",
64 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
69 vectorLayer.addFeatures([feature,featureCentre]);
71 vectorLayer.addFeatures([feature]);
77 <body onload="init();">
81 if ($aPointDetails['icon'])
83 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'" alt="'.$aPointDetails['icon'].'" />';
85 echo $aPointDetails['localname'].'</h1>';
86 echo '<div class="locationdetails">';
88 foreach($aPointDetails['aNames'] as $sKey => $sValue)
90 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
93 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
94 echo ' <div>Last Updated: <span class="type">'.$aPointDetails['indexed_date'].'</span></div>';
95 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
96 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
97 if ($aPointDetails['calculated_importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)').'</span></div>';
98 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
99 echo ' <div>Centre Point: <span class="area">'.$aPointDetails['lat'].','.$aPointDetails['lon'].'</span></div>';
100 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
101 if ($sOSMType) echo ' <div>OSM: <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPointDetails['osm_id'].'">'.$aPointDetails['osm_id'].'</a></span></div>';
102 if ($aPointDetails['wikipedia'])
104 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
105 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
107 echo ' <div>Extra Tags: ';
108 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
110 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
115 echo '<h2>Address</h2>';
116 echo '<div class="address">';
117 $iPrevRank = 1000000;
118 $sPrevLocalName = '';
119 foreach($aAddressLines as $aAddressLine)
121 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
123 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
124 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
126 $iPrevRank = $aAddressLine['rank_address'];
127 $sPrevLocalName = $aAddressLine['localname'];
129 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
131 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
132 if ($sOSMType) echo ', <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
133 if (isset($aAddressLine['admin_level'])) echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
134 if (isset($aAddressLine['rank_search_label'])) echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
135 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
136 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
137 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
145 echo '<h2>Linked Places</h2>';
146 echo '<div class=\"linked\">';
147 foreach($aLinkedLines as $aAddressLine)
149 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
151 echo '<div class="line">';
152 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
154 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
155 if ($sOSMType) echo ', <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
156 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
157 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
158 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
159 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
160 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
167 if ($aPlaceSearchNameKeywords)
169 echo '<h2>Name Keywords</h2>';
170 foreach($aPlaceSearchNameKeywords as $aRow)
172 echo '<div>'.$aRow['word_token'].'</div>';
176 if ($aPlaceSearchAddressKeywords)
178 echo '<h2>Address Keywords</h2>';
179 foreach($aPlaceSearchAddressKeywords as $aRow)
181 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
185 if (sizeof($aParentOfLines))
187 echo '<h2>Parent Of:</h2>';
189 $aGroupedAddressLines = array();
190 foreach($aParentOfLines as $aAddressLine)
192 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
193 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
195 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
197 $sGroupHeading = ucwords($sGroupHeading);
198 echo "<h3>$sGroupHeading</h3>";
199 foreach($aParentOfLines as $aAddressLine)
201 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
202 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
204 echo '<div class="line">';
205 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
207 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
208 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
209 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
210 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
211 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
212 if ($sOSMType) echo ', <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
213 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
218 if (sizeof($aParentOfLines) >= 500) {
219 echo '<p>There are more child objects which are not shown.</p>';
224 // echo '<h2>Other Parts:</h2>';
225 // echo '<h2>Linked To:</h2>';