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.TouchNavigation({
23 dragPanOptions: { enableKinetic: true }
25 new OpenLayers.Control.Attribution()],
26 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
27 maxResolution: 156543.0399,
30 projection: new OpenLayers.Projection("EPSG:900913"),
31 displayProjection: new OpenLayers.Projection("EPSG:4326")
33 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
35 var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
36 layer_style.fillOpacity = 0.2;
37 layer_style.graphicOpacity = 0.2;
39 vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
40 map.addLayer(vectorLayer);
42 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
43 var proj_map = map.getProjectionObject();
45 freader = new OpenLayers.Format.WKT({
46 'internalProjection': proj_map,
47 'externalProjection': proj_EPSG4326
50 var feature = freader.read('<?php echo $aPointDetails['outlinestring'];?>');
51 var featureCentre = freader.read('POINT(<?php echo $aPointDetails['lon'];?> <?php echo $aPointDetails['lat'];?>)');
53 map.zoomToExtent(feature.geometry.getBounds());
55 strokeColor: "#75ADFF",
57 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
63 <?php if ($aPointDetails['isarea']=='t') {?>
64 featureCentre.style = {
65 strokeColor: "#008800",
67 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
72 vectorLayer.addFeatures([feature,featureCentre]);
74 vectorLayer.addFeatures([feature]);
80 <body onload="init();">
84 if ($aPointDetails['icon'])
86 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
88 echo $aPointDetails['localname'].'</h1>';
89 echo '<div class="locationdetails">';
91 foreach($aPointDetails['aNames'] as $sKey => $sValue)
93 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
96 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
97 echo ' <div>Last Updated: <span class="type">'.$aPointDetails['indexed_date'].'</span></div>';
98 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
99 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
100 if ($aPointDetails['calculated_importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)').'</span></div>';
101 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
102 echo ' <div>Centre Point: <span class="area">'.$aPointDetails['lat'].','.$aPointDetails['lon'].'</span></div>';
103 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
104 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>';
105 if ($aPointDetails['wikipedia'])
107 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
108 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
110 echo ' <div>Extra Tags: ';
111 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
113 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
118 echo '<h2>Address</h2>';
119 echo '<div class="address">';
120 $iPrevRank = 1000000;
121 $sPrevLocalName = '';
122 foreach($aAddressLines as $aAddressLine)
124 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
126 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
127 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
129 $iPrevRank = $aAddressLine['rank_address'];
130 $sPrevLocalName = $aAddressLine['localname'];
132 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
134 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
135 if ($sOSMType) echo ', <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
136 if (isset($aAddressLine['admin_level'])) echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
137 if (isset($aAddressLine['rank_search_label'])) echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
138 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
139 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
140 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
148 echo '<h2>Linked Places</h2>';
149 echo '<div class=\"linked\">';
150 foreach($aLinkedLines as $aAddressLine)
152 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
154 echo '<div class="line">';
155 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
157 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
158 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>';
159 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
160 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
161 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
162 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
163 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
170 if ($aPlaceSearchNameKeywords)
172 echo '<h2>Name Keywords</h2>';
173 foreach($aPlaceSearchNameKeywords as $aRow)
175 echo '<div>'.$aRow['word_token'].'</div>';
179 if ($aPlaceSearchAddressKeywords)
181 echo '<h2>Address Keywords</h2>';
182 foreach($aPlaceSearchAddressKeywords as $aRow)
184 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
188 if (sizeof($aParentOfLines))
190 echo '<h2>Parent Of:</h2>';
192 $aGroupedAddressLines = array();
193 foreach($aParentOfLines as $aAddressLine)
195 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
196 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
198 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
200 $sGroupHeading = ucwords($sGroupHeading);
201 echo "<h3>$sGroupHeading</h3>";
202 foreach($aParentOfLines as $aAddressLine)
204 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
205 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
207 echo '<div class="line">';
208 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
210 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
211 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
212 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
213 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
214 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
215 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>';
216 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
221 if (sizeof($aParentOfLines) >= 500) {
222 echo '<p>There are more child objects which are not shown.</p>';
227 // echo '<h2>Other Parts:</h2>';
228 // echo '<h2>Linked To:</h2>';