Search.md - update XML and JSON example output

This commit is contained in:
marc tobias
2023-08-04 13:15:50 +02:00
parent 671f4e943e
commit 5683f55646

View File

@@ -174,116 +174,136 @@ This overrides the specified machine readable format. (Default: 0)
## Examples ## Examples
##### XML with kml polygon ##### XML with KML polygon
* [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_geojson=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_geojson=1&addressdetails=1) * [https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1](https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue,+birmingham&format=xml&polygon_kml=1&addressdetails=1)
```xml ```xml
<searchresults timestamp="Sat, 07 Nov 09 14:42:10 +0000" querystring="135 pilkington, avenue birmingham" polygon="true"> <?xml version="1.0" encoding="UTF-8" ?>
<place <searchresults timestamp="Tue, 08 Aug 2023 15:45:41 +00:00"
place_id="1620612" osm_type="node" osm_id="452010817" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright"
boundingbox="52.548641204834,52.5488433837891,-1.81612110137939,-1.81592094898224" querystring="135 pilkington avenue, birmingham"
lat="52.5487429714954" lon="-1.81602098644987" more_url="https://nominatim.openstreetmap.org/search?q=135+pilkington+avenue%2C+birmingham&amp;polygon_kml=1&amp;addressdetails=1&amp;limit=20&amp;exclude_place_ids=125279639&amp;format=xml"
display_name="135, Pilkington Avenue, Wylde Green, City of Birmingham, West Midlands (county), B72, United Kingdom" exclude_place_ids="125279639">
class="place" type="house"> <place place_id="125279639"
<geokml> osm_type="way"
<Polygon> osm_id="90394480"
<outerBoundaryIs> lat="52.5487921"
<LinearRing> lon="-1.8164308"
<coordinates>-1.816513,52.548756599999997 -1.816434,52.548747300000002 -1.816429,52.5487629 -1.8163717,52.548756099999999 -1.8163464,52.548834599999999 -1.8164599,52.548848100000001 -1.8164685,52.5488213 -1.8164913,52.548824000000003 -1.816513,52.548756599999997</coordinates> boundingbox="52.5487473,52.5488481,-1.8165130,-1.8163464"
</LinearRing> place_rank="30"
</outerBoundaryIs> address_rank="30"
</Polygon> display_name="135, Pilkington Avenue, Maney, Sutton Coldfield, Wylde Green, Birmingham, West Midlands Combined Authority, England, B72 1LH, United Kingdom"
</geokml> class="building"
<house_number>135</house_number> type="residential"
<road>Pilkington Avenue</road> importance="9.999999994736442e-08">
<village>Wylde Green</village> <geokml>
<town>Sutton Coldfield</town> <Polygon>
<city>City of Birmingham</city> <outerBoundaryIs>
<county>West Midlands (county)</county> <LinearRing>
<postcode>B72</postcode> <coordinates>-1.816513,52.5487566 -1.816434,52.5487473 -1.816429,52.5487629 -1.8163717,52.5487561 -1.8163464,52.5488346 -1.8164599,52.5488481 -1.8164685,52.5488213 -1.8164913,52.548824 -1.816513,52.5487566</coordinates>
<country>United Kingdom</country> </LinearRing>
<country_code>gb</country_code> </outerBoundaryIs>
</place> </Polygon>
</searchresults> </geokml>
<house_number>135</house_number>
<road>Pilkington Avenue</road>
<hamlet>Maney</hamlet>
<town>Sutton Coldfield</town>
<village>Wylde Green</village>
<city>Birmingham</city>
<ISO3166-2-lvl8>GB-BIR</ISO3166-2-lvl8>
<state_district>West Midlands Combined Authority</state_district>
<state>England</state>
<ISO3166-2-lvl4>GB-ENG</ISO3166-2-lvl4>
<postcode>B72 1LH</postcode>
<country>United Kingdom</country>
<country_code>gb</country_code>
</place>
</searchresults>
``` ```
##### JSON with SVG polygon ##### JSON with SVG polygon
[https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search/Unter%20den%20Linden%201%20Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1) [https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1](https://nominatim.openstreetmap.org/search?q=Unter%20den%20Linden%201%20Berlin&format=json&addressdetails=1&limit=1&polygon_svg=1)
```json ```json
{ [
"address": { {
"city": "Berlin", "address": {
"city_district": "Mitte", "ISO3166-2-lvl4": "DE-BE",
"construction": "Unter den Linden", "borough": "Mitte",
"continent": "European Union", "city": "Berlin",
"country": "Deutschland", "country": "Deutschland",
"country_code": "de", "country_code": "de",
"house_number": "1", "historic": "Kommandantenhaus",
"neighbourhood": "Scheunenviertel", "house_number": "1",
"postcode": "10117", "neighbourhood": "Friedrichswerder",
"public_building": "Kommandantenhaus", "postcode": "10117",
"state": "Berlin", "road": "Unter den Linden",
"suburb": "Mitte" "suburb": "Mitte"
}, },
"boundingbox": [ "boundingbox": [
"52.5170783996582", "52.5170798",
"52.5173187255859", "52.5173311",
"13.3975105285645", "13.3975116",
"13.3981599807739" "13.3981577"
], ],
"class": "amenity", "class": "historic",
"display_name": "Kommandantenhaus, 1, Unter den Linden, Scheunenviertel, Mitte, Berlin, 10117, Deutschland, European Union", "display_name": "Kommandantenhaus, 1, Unter den Linden, Friedrichswerder, Mitte, Berlin, 10117, Deutschland",
"importance": 0.73606775332943, "importance": 0.8135042058306902,
"lat": "52.51719785", "lat": "52.51720765",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright", "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"lon": "13.3978352028938", "lon": "13.397834399325466",
"osm_id": "15976890", "osm_id": 15976890,
"osm_type": "way", "osm_type": "way",
"place_id": "30848715", "place_id": 108681845,
"svg": "M 13.397511 -52.517283599999999 L 13.397829400000001 -52.517299800000004 13.398131599999999 -52.517315099999998 13.398159400000001 -52.517112099999999 13.3975388 -52.517080700000001 Z", "svg": "M 13.3975116 -52.5172905 L 13.397549 -52.5170798 13.397715 -52.5170906 13.3977122 -52.5171064 13.3977392 -52.5171086 13.3977417 -52.5170924 13.3979655 -52.5171069 13.3979623 -52.5171233 13.3979893 -52.5171248 13.3979922 -52.5171093 13.3981577 -52.5171203 13.398121 -52.5173311 13.3978115 -52.5173103 Z",
"type": "public_building" "type": "house"
} }
]
``` ```
##### JSON with address details ##### JSON with address details
[https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1](https://nominatim.openstreetmap.org/?addressdetails=1&q=bakery+in+berlin+wedding&format=json&limit=1) [https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1](https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1)
```json ```json
{ [
"address": { {
"bakery": "B\u00e4cker Kamps", "address": {
"city_district": "Mitte", "ISO3166-2-lvl4": "DE-BE",
"continent": "European Union", "borough": "Mitte",
"country": "Deutschland", "city": "Berlin",
"country_code": "de", "country": "Deutschland",
"footway": "Bahnsteig U6", "country_code": "de",
"neighbourhood": "Sprengelkiez", "neighbourhood": "Sprengelkiez",
"postcode": "13353", "postcode": "13347",
"state": "Berlin", "road": "Lindower Straße",
"suburb": "Wedding" "shop": "Ditsch",
}, "suburb": "Wedding"
"boundingbox": [ },
"52.5460929870605", "addresstype": "shop",
"52.5460968017578", "boundingbox": [
"13.3591794967651", "52.5427201",
"13.3591804504395" "52.5427654",
], "13.3668619",
"class": "shop", "13.3669442"
"display_name": "B\u00e4cker Kamps, Bahnsteig U6, Sprengelkiez, Wedding, Mitte, Berlin, 13353, Deutschland, European Union", ],
"icon": "https://nominatim.openstreetmap.org/images/mapicons/shopping_bakery.p.20.png", "category": "shop",
"importance": 0.201, "display_name": "Ditsch, Lindower Straße, Sprengelkiez, Wedding, Mitte, Berlin, 13347, Deutschland",
"lat": "52.5460941", "importance": 9.99999999995449e-06,
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright", "lat": "52.54274275",
"lon": "13.35918", "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_id": "317179427", "lon": "13.36690305710228",
"osm_type": "node", "name": "Ditsch",
"place_id": "1453068", "osm_id": 437595031,
"type": "bakery" "osm_type": "way",
} "place_id": 204751033,
"place_rank": 30,
"type": "bakery"
}
]
``` ```
##### GeoJSON ##### GeoJSON