Created
May 17, 2014 21:45
-
-
Save toin0u/5088f122a5c027087d5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP/1.1 200 OK | |
Date: Sat, 17 May 2014 21:45:16 GMT | |
Server: Apache/2.2.22 (Ubuntu) | |
Content-Location: search.php | |
Vary: negotiate,accept | |
TCN: choice | |
X-Powered-By: PHP/5.3.10-1ubuntu3.11 | |
Access-Control-Allow-Origin: * | |
Access-Control-Allow-Methods: OPTIONS,GET | |
Access-Control-Max-Age: 8640000 | |
Connection: close | |
Transfer-Encoding: chunked | |
Content-Type: text/xml; charset=UTF-8 | |
ca8 | |
<?xml version="1.0" encoding="UTF-8" ?> | |
<searchresults timestamp='Sat, 17 May 14 21:45:16 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='Paris' polygon='false' exclude_place_ids='97923440,97357969,42637879,42729434,97962432' more_url='http://nominatim.openstreetmap.org/search?format=xml&exclude_place_ids=97923440,97357969,42637879,42729434,97962432&addressdetails=1&q=Paris'> | |
<place place_id='97923440' osm_type='relation' osm_id='7444' place_rank='16' boundingbox="48.8155746459961,48.902156829834,2.22412180900574,2.46976041793823" lat='48.8565056' lon='2.3521334' display_name='Paris, Île-de-France, France métropolitaine, France' class='place' type='city' importance='0.97893459932191' icon='http://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png'> | |
<city>Paris</city><county>Paris</county><state>Île-de-France</state><country>France</country><country_code>fr</country_code></place><place place_id='97357969' osm_type='relation' osm_id='71525' place_rank='12' boundingbox="48.8155746459961,48.902156829834,2.22412180900574,2.46976041793823" lat='48.85886575' lon='2.32003761177144' display_name='Paris, Île-de-France, France métropolitaine, France' class='boundary' type='administrative' importance='0.97893459932191' icon='http://nominatim.openstreetmap.org/images/mapicons/poi_boundary_administrative.p.20.png'> | |
<county>Paris</county><state>Île-de-France</state><country>France</country><country_code>fr</country_code></place><place place_id='42637879' osm_type='way' osm_id='33063046' place_rank='16' boundingbox="35.2672462463379,35.3065032958984,-93.7618103027344,-93.6750793457031" lat='35.28687645' lon='-93.7354879210082' display_name='Paris, Logan County, Arkansas, United States of America' class='place' type='city' importance='0.68385884862688' icon='http://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png'> | |
<city>Paris</city><county>Logan County</county><state>Arkansas</state><country>United States of America</country><country_code>us</country_code></place><place place_id='42729434' osm_type='way' osm_id='33299478' place_rank='16' boundingbox="33.6118507385254,33.7383804321289,-95.6279296875,-95.4354476928711" lat='33.6751155' lon='-95.5502662477703' display_name='Paris, Lamar County, Texas, United States of America' class='place' type='city' importance='0.55374443751163' icon='http://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png'> | |
<city>Paris</city><county>Lamar County</county><state>Texas</state><country>United States of America</country><country_code>us</country_code></place><place place_id='97962432' osm_type='relation' osm_id='130722' place_rank='16' boundingbox="38.1649208068848,38.2382736206055,-84.3073272705078,-84.2320861816406" lat='38.2097987' lon='-84.2529869' display_name='Paris, Bourbon County, Kentucky, United States of America' class='place' type='city' importance='0.5208263210417' icon='http://nominatim.openstreetmap.org/images/mapicons/poi_place_city.p.20.png'> | |
<city>Paris</city><county>Bourbon County</county><state>Kentucky</state><country>United States of America</country><country_code>us</country_code></place></searchresults> | |
0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fp = fsockopen("nominatim.openstreetmap.org", 80, $errno, $errstr); | |
if (!$fp) { | |
die("$errstr ($errno)<br />\n"); | |
} | |
$out = "GET /search?q=Paris&format=xml&addressdetails=1&limit=5 HTTP/1.1\r\n"; | |
$out .= "Host: nominatim.openstreetmap.org\r\n"; | |
$out .= "Connection: Close\r\n\r\n"; | |
fwrite($fp, $out); | |
while (!feof($fp)) { | |
echo fgets($fp); | |
} | |
fclose($fp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment