Anomalie #225
ferméLe plugin Isochrone ne fonctionne plus
0%
Description
Probablement liè au passage en https du site de l'IGN.
diagnostic à faire. Olivier MAury n'a pas le temps d'adapater son plugin à la version 3 de QGIS. Il peut fournir un script à lancer via la console python.
Ne faudrait-il pas réaliser plutôt un plugin ajoutant un nouvel algorithme Isochrone ?
Fichiers
Mis à jour par alain ferraton il y a environ 5 ans
le code de Olivier Maury pour tester la réponse de l'IGN :
#!/usr/bin/python3.5
import urllib.request
url="https://wxs.ign.fr/iqqdkoa235g0mf1gr3si0162/isochrone/isochrone.xml?location=935800,6850112&srs=epsg:2154&method=Time&graph=Voiture&graphName=Voiture&exclusions=&time=1200&holes=false&smoothing=false"
request = urllib.request.Request(url)
valid="False"
try:
response = urllib.request.urlopen(request)
htmlBytes = response.read()
htmlStr = htmlBytes.decode("utf8")
print ("something cool")
valid="True"
except:
print("something wrong")
if valid =="True" :
tab_iso=htmlStr
index1=tab_iso.find("wktGeometry")
index2=tab_iso.rfind("wktGeometry")
index3=len(tab_iso)
iso=tab_iso[index1+12:index2-2]
mLayer = QgsVectorLayer('Polygon?crs=epsg:4326', "test", "memory")
mProvider = mLayer.dataProvider()
geomWkt= iso
geomPoly = QgsGeometry.fromWkt(geomWkt)
feat = QgsFeature()
feat.setGeometry(geomPoly)
mProvider.addFeatures( [feat] )
mLayer.commitChanges()
mLayer.updateExtents()
if mLayer.isValid():
QgsProject.instance().addMapLayer(mLayer)
Mis à jour par alain ferraton il y a environ 5 ans
Mis à jour par alain ferraton il y a presque 4 ans
- Statut changé de Nouveau à Fermé
Nouvelle version réalisée par le pôle géomatique