qgis2web / qgis2web

QGIS plugin to export your project to an OpenLayers or Leaflet webmap. No server-side software required.
https://plugins.qgis.org/plugins/qgis2web/
GNU General Public License v2.0
566 stars 146 forks source link

I'm unable to export REST API layers from ArcGIS Map Service; latest version #1043

Closed ForestEco closed 4 months ago

ForestEco commented 7 months ago

I get a Python error where the exporter searches for a path to the TEMP directory for the REST service API layer, but it isn't located where the exporter expects it to be.

My thoughts on solving this were:

  1. Find a way to locate a temp REST service object if possible on my client side and see if I can pass it to a new path and let the exporter locate it. However, it appears to be all directly from the REST service URL, there doesn't seem to be a intermediate step for the layer to be built on the client temporarily to locate or I need to better understand how to rewrite my path options for ArcGIS service on QGIS. -If someone knows how to work around this would be helpful!
  2. Build a raster layer, then try to edit the source code myself in javascript, reroute the raster object to the API URL instead. But I think this will not work because the REST service isn't just a standard local object to compile, it needs intermediate steps to build the object data from the server then add it from what I think is geoJSON.

Here's the error I have: An error has occurred while executing Python code:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jsaf\AppData\Local\Temp\ProtectedAreasDatabaseoftheUnitedStatesPADUSv3001701282171_piped.tif' Traceback (most recent call last): File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 419, in exportRaster processing.run("gdal:warpreproject", warpArgs) File "C:\PROGRA~1/QGIS31~1.15/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 108, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:\PROGRA~1/QGIS31~1.15/apps/qgis-ltr/./python/plugins\processing\core\Processing.py", line 168, in runAlgorithm raise QgsProcessingException(msg) _core.QgsProcessingException: Unable to execute algorithm Could not load source layer for INPUT: C:\Users\jsaf\AppData\Local\Temp\ProtectedAreasDatabaseoftheUnitedStatesPADUSv3001701282171_piped.tif not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\qgis2web.py", line 59, in run self.dlg = MainDialog(self.iface) File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 159, in init self.autoUpdatePreview() File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 334, in autoUpdatePreview self.previewMap() File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 337, in previewMap preview_file = self.createPreview() File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 299, in createPreview return writer.write(self.iface, File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\olwriter.py", line 81, in write self.preview_file = self.writeOL(iface, feedback, File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\olwriter.py", line 130, in writeOL exportLayers(iface, layers, folder, precision, optimize, File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 237, in exportLayers exportRaster(layer, count, layersFolder, feedback, iface, matchCRS) File "C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\utils.py", line 421, in exportRaster shutil.copyfile(piped_file, piped_3857) File "C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\jsaf\AppData\Local\Temp\ProtectedAreasDatabaseoftheUnitedStatesPADUSv3001701282171_piped.tif'

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.16.15-Hannover Hannover, e7fdad64

Python Path: C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HTML_Generator-main C:/PROGRA~1/QGIS31~1.15/apps/qgis-ltr/./python C:/Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA~1/QGIS31~1.15/apps/qgis-ltr/./python/plugins C:\Program Files\QGIS 3.16.15\bin\python39.zip C:\PROGRA~1\QGIS31~1.15\apps\Python39\DLLs C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib C:\Program Files\QGIS 3.16.15\bin C:\Users\jsaf\AppData\Roaming\Python\Python39\site-packages C:\PROGRA~1\QGIS31~1.15\apps\Python39 C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\site-packages C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\site-packages\GDAL-3.4.0-py3.9-win-amd64.egg C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\site-packages\win32 C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\site-packages\win32\lib C:\PROGRA~1\QGIS31~1.15\apps\Python39\lib\site-packages\Pythonwin C:/Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\jsaf\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\go2streetview\res C:\Users\jsaf\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\mmqgis/forms C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web C:\Users\jsaf\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing C:\Users\jsaf\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing C:\Users\jsaf\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs . C:/Users/jsaf/OneDrive/Desktop/Maps/Geology_Geospatial_Data C:\Users/jsaf/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\go2streetview

andreaordonselli commented 4 months ago

Dear user, it is not my intention to explore the resolution of this problem, I recommend you contact the site https://gis.stackexchange.com/ Best regards.