]> git.openstreetmap.org Git - nominatim.git/commitdiff
surpress output of osm_type/id for non-OSM objects in reverse xml
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 5 Feb 2014 19:10:12 +0000 (20:10 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 5 Feb 2014 19:10:12 +0000 (20:10 +0100)
lib/template/address-xml.php

index 0747844a67ac6db8a8306f0dc74152c3b36d6364..9eeb3b778a6c5737d76a49ee33cfd3455fa47081 100644 (file)
@@ -22,7 +22,8 @@
        {
                echo "<result";
                if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';
-               if ($aPlace['osm_type'] && $aPlace['osm_id']) echo ' osm_type="'.($aPlace['osm_type']=='N'?'node':($aPlace['osm_type']=='W'?'way':'relation')).'"'.' osm_id="'.$aPlace['osm_id'].'"';
+               $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
+               if ($sOSMType) echo ' osm_type="'.$sOSMType.'"'.' osm_id="'.$aPlace['osm_id'].'"';
                if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';
                if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';
                if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';