sigdeletras / Spanish_Inspire_Catastral_Downloader

A QGIS plugin to download cadastral data from INSPIRE Services of Spanish Cadastral Cartography
GNU General Public License v3.0
23 stars 10 forks source link

Failed on Mac #4

Closed jesbrz closed 6 years ago

jesbrz commented 6 years ago

I found this error trying to run Spanish_Inspire_Catastral_Downloader on Qgis3 for Mac. Any help?

Ha ocurrido un error mientras se ejecutaba el código de Python: 

AttributeError: type object 'QgsMessageBar' has no attribute 'WARNING' 
Traceback (most recent call last):
  File "/Volumes/Suevia/Users/jesus/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/Spanish_Inspire_Catastral_Downloader/Spanish_Inspire_Catastral_Downloader.py", line 390, in download
    self.msgBar.pushMessage("Finished!" , level=QgsMessageBar.SUCCESS, duration=3)
AttributeError: type object 'QgsMessageBar' has no attribute 'SUCCESS'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Volumes/Suevia/Users/jesus/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/Spanish_Inspire_Catastral_Downloader/Spanish_Inspire_Catastral_Downloader.py", line 420, in download
    self.msgBar.pushMessage("Failed! "+ str(e) , level=QgsMessageBar.WARNING, duration=3)
AttributeError: type object 'QgsMessageBar' has no attribute 'WARNING'

Versión de Python: 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] 
Versión de QGIS: 3.0.0-Girona Girona, exported 

Ruta de Python:
/Applications/QGIS 3.app/Contents/MacOS/../Resources/python
/Volumes/Suevia/Users/jesus/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Volumes/Suevia/Users/jesus/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS 3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/GEOS.framework/Versions/3B/Python/3.6/site-packages
/Library/Frameworks/GDAL.framework/Versions/2.2/Python/3.6/site-packages
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Volumes/Suevia/Users/jesus/Library/Application Support/QGIS/QGIS3/profiles/default/python
D:\eclipse\plugins\org.python.pydev_5.7.0.201704111357/pysrc
D:\eclipse\plugins\org.python.pydev_5.7.0.201704111357/pysrc

The plugin generates the files but I can not open them with Qgis3 although with 2.18.15 it opens normally.

danihuge commented 6 years ago

Same here on Windows 10, thanks.

sigdeletras commented 6 years ago

Hi @danihuge , Effectively, an error was detected in QGIS3 caused by a change in the API. It has also been detected that, at least in version 3.0, QGIS has problems in representing GML layers, which is the format downloaded from the ATOM services of the Inspire Cadastre. I'm waiting to fix it. Thanks for the issue

Patricio

danihuge commented 6 years ago

thanks for your quick reply! Already testing in V2.

ccamara commented 6 years ago

I have the same problem in Kubuntu 18.04. Using QGIS 3.0.3 and plugin version 0.4. Even when I do not check to add downloaded data into the project.

sigdeletras commented 6 years ago

Saludos @ccamara Como le comenté a @danihuge el complemento no está preparado para QGIS 3 por un tema de la API. He decido bajar la versión en la que está disponible. Además, al menos en la versión 3.0.2 QGIS sigue sin poder cargar los GML de Catastro correctamente.

ccamara commented 6 years ago

Gracias por la aclaración. Al ver que estaba cerrada la issue pensé que se había resuelto en una supuesta versión 2 del plugin, pero parece que la solución pasa por usar QGIS 2.x

¿Hay alguna estimación de si podrá usarse en QGIS 3.x y, en caso afirmativo, cuando sería?

sigdeletras commented 6 years ago

Pues la verdad es que al ser un tema del core de QGIS muy específico no tengo idea. Ni siquiera he puesto un bug en la página de errores. Lo he comentado en el grupo QGIS de Telegram donde están los "sabios" y no han sabido decirme nada. El error de la API ya lo tenía controlado, pero al darme cuenta que de todas formas no cargaba GML Catastro decidí mejor bajar la versión. Como posible soluciones he pensado convertir los gml descargados a otros fichero, tipo geopackage, pero para eso necesito tiempo.

All4Gis commented 6 years ago

Asignamela a mi si quieres esta issue!

sigdeletras commented 6 years ago

Genial Fran! He Añadido try/except para que pueda también ser usado para QGIS 2.* He añadido a la función gml2geojson la salida en EPGS:25830. No se indicaba el parámetro de salida y lo creaba en 4326

sigdeletras commented 6 years ago

Disponible la versión 1.0 con mejoras de @All4Gis. El complemento guarda ahora los archivos en geojson por lo que funciona en QGIS3.

danihuge commented 6 years ago

Thanks guys!!!