[OSM-talk-fr] Requête overpass api & python
Tony Emery
tony.emery at yahoo.fr
Mer 22 Juin 07:19:19 UTC 2016
Ma requête doit ressembler à ça :
#
http://overpass-api.de/api/interpreter?[out:xml][timeout:65];(node["highway"](43.98,4.70,44.27,4.99);way["highway"](43.98,4.70,44.27,4.99);relation["highway"](43.98,4.70,44.27,4.99););out
meta asc;>;out meta qt;
Et quand j'ajoute les paramètre, dans mon script Python, ça donne ça :
query
='[out:xml][timeout:{0}];(node{1}{2};way{1}{2};relation{1}{2};);out meta
asc;>;out meta qt;'.format(timeout,requete, bbox)
query = query.encode('utf8')
query_string = urllib.urlencode({'data': query})
msgLog = ('2.1.4 Lancement de la requête : {0}').format(requete)
insertMessageLogFile(logfilePath, msgLog)
try:
data = urllib2.urlopen(url=urlxapi, data=query_string).read()
except urllib2.HTTPError as e:
if e.code == 400:
print 'Bad request overpass'
# exit()
continue
-----
Tony EMERY
Administrateur OpenStreetMap.fr
Mandataire Grand Sud-Est
Géomaticien & chef de projets
--
View this message in context: http://gis.19327.n5.nabble.com/Requete-overpass-api-python-tp5863030p5876139.html
Sent from the France mailing list archive at Nabble.com.
Plus d'informations sur la liste de diffusion Talk-fr