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.MouseDefaults(),
22 new OpenLayers.Control.MousePosition(),
23 new OpenLayers.Control.Attribution()],
24 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
25 maxResolution: 156543.0399,
28 projection: new OpenLayers.Projection("EPSG:900913"),
29 displayProjection: new OpenLayers.Projection("EPSG:4326")
31 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
33 var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
34 layer_style.fillOpacity = 0.2;
35 layer_style.graphicOpacity = 0.2;
37 vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
38 map.addLayer(vectorLayer);
40 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
41 var proj_map = map.getProjectionObject();
43 freader = new OpenLayers.Format.WKT({
44 'internalProjection': proj_map,
45 'externalProjection': proj_EPSG4326
48 var feature = freader.read('<?php echo $aPointDetails['outlinestring'];?>');
49 var featureCentre = freader.read('POINT(<?php echo $aPointDetails['lon'];?> <?php echo $aPointDetails['lat'];?>)');
51 map.zoomToExtent(feature.geometry.getBounds());
53 strokeColor: "#75ADFF",
55 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
61 <?php if ($aPointDetails['isarea']=='t') {?>
62 featureCentre.style = {
63 strokeColor: "#008800",
65 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
70 vectorLayer.addFeatures([feature,featureCentre]);
72 vectorLayer.addFeatures([feature]);
78 <body onload="init();">
82 if ($aPointDetails['icon'])
84 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
86 echo $aPointDetails['localname'].'</h1>';
87 echo '<div class="locationdetails">';
89 foreach($aPointDetails['aNames'] as $sKey => $sValue)
91 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
94 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
95 echo ' <div>Last Updated: <span class="type">'.$aPointDetails['indexed_date'].'</span></div>';
96 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
97 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
98 if ($aPointDetails['calculated_importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)').'</span></div>';
99 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
100 echo ' <div>Centre Point: <span class="area">'.$aPointDetails['lat'].','.$aPointDetails['lon'].'</span></div>';
101 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
102 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>';
103 if ($aPointDetails['wikipedia'])
105 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
106 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
108 echo ' <div>Extra Tags: ';
109 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
111 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
116 echo '<h2>Address</h2>';
117 echo '<div class="address">';
118 $iPrevRank = 1000000;
119 $sPrevLocalName = '';
120 foreach($aAddressLines as $aAddressLine)
122 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
124 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
125 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
127 $iPrevRank = $aAddressLine['rank_address'];
128 $sPrevLocalName = $aAddressLine['localname'];
130 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
132 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
133 if ($sOSMType) echo ', <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
134 if (isset($aAddressLine['admin_level'])) echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
135 if (isset($aAddressLine['rank_search_label'])) echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
136 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
137 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
138 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
146 echo '<h2>Linked Places</h2>';
147 echo '<div class=\"linked\">';
148 foreach($aLinkedLines as $aAddressLine)
150 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
152 echo '<div class="line">';
153 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
155 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
156 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>';
157 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
158 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
159 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
160 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
161 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
168 if ($aPlaceSearchNameKeywords)
170 echo '<h2>Name Keywords</h2>';
171 foreach($aPlaceSearchNameKeywords as $aRow)
173 echo '<div>'.$aRow['word_token'].'</div>';
177 if ($aPlaceSearchAddressKeywords)
179 echo '<h2>Address Keywords</h2>';
180 foreach($aPlaceSearchAddressKeywords as $aRow)
182 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
186 if (sizeof($aParentOfLines))
188 echo '<h2>Parent Of:</h2>';
190 $aGroupedAddressLines = array();
191 foreach($aParentOfLines as $aAddressLine)
193 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
194 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
196 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
198 $sGroupHeading = ucwords($sGroupHeading);
199 echo "<h3>$sGroupHeading</h3>";
200 foreach($aParentOfLines as $aAddressLine)
202 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
203 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
205 echo '<div class="line">';
206 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
208 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
209 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
210 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
211 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
212 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
213 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>';
214 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
219 if (sizeof($aParentOfLines) >= 500) {
220 echo '<p>There are more child objects which are not shown.</p>';
225 // echo '<h2>Other Parts:</h2>';
226 // echo '<h2>Linked To:</h2>';