-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qgis_process doesn't seem to handle remote layers #54264
Comments
Adding an additional example here, now using an online geopackage vector layer: $ ogrinfo https://github.com/r-spatial/qgisprocess/raw/main/inst/longlake/longlake.gpkg
INFO: Open of `https://github.com/r-spatial/qgisprocess/raw/main/inst/longlake/longlake.gpkg'
using driver `GPKG' successful.
1: longlake (3D Polygon)
$
$ qgis_process run native:buffer --INPUT='https://github.com/r-spatial/qgisprocess/raw/main/inst/longlake/longlake.gpkg|layername=longlake' --OUTPUT=TEMPORARY_OUTPUT
----------------
Inputs
----------------
INPUT: https://github.com/r-spatial/qgisprocess/raw/main/inst/longlake/longlake.gpkg|layername=longlake
OUTPUT: TEMPORARY_OUTPUT
ERROR: An error was encountered while checking parameter values
Could not load source layer for INPUT: https://github.com/r-spatial/qgisprocess/raw/main/inst/longlake/longlake.gpkg|layername=longlake not found
$
$ qgis_process --version
QGIS 3.32.2-Lima 'Lima' (d3e85889c7)
QGIS code revision d3e85889c7
Qt version 5.15.3
Python version 3.10.12
GDAL/OGR version 3.6.4
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.37.2
OS Linux Mint 21.2
|
@florisvdh , you'll need to prefix your input string with |
@nirvn -- actually there's more to it then that. There's a hardcoded assumption in processing when layer sources are tested that if the provider is gdal or ogr, then we check QFile::exists and fail if the source doesn't exist. There's a number of similar assumptions scattered around which need to be re-worked. |
@nyalldawson , good to know. |
Same issue with S3 and |
…files Its better to defer this to that data provider, as the uri may not need to correspond to an actual on disk file for some providers. Eg ogr provider can load remote http sources Fixes qgis#54264
…files Its better to defer this to that data provider, as the uri may not need to correspond to an actual on disk file for some providers. Eg ogr provider can load remote http sources Fixes #54264
…files Its better to defer this to that data provider, as the uri may not need to correspond to an actual on disk file for some providers. Eg ogr provider can load remote http sources Fixes #54264
…files Its better to defer this to that data provider, as the uri may not need to correspond to an actual on disk file for some providers. Eg ogr provider can load remote http sources Fixes #54264
Confirmed for the COG 🎉 using QGIS 3.34.3. $ wget -q https://github.com/r-spatial/sf/raw/main/inst/gpkg/b_pump.gpkg
$
$ qgis_process run native:rastersampling --distance_units=meters --area_units=m2 --ellipsoid=EPSG:7030 --INPUT='b_pump.gpkg|layername=b_pump' --RASTERCOPY='/vsicurl/https://s3.eu-central-1.wasabisys.com/openlandmap/dtm/dtm.bareearth_ensemble_p10_30m_s_2018_go_epsg4326_v20230221.tif' --COLUMN_PREFIX=SAMPLE_ --OUTPUT=TEMPORARY_OUTPUT
----------------
Inputs
----------------
COLUMN_PREFIX: SAMPLE_
INPUT: b_pump.gpkg|layername=b_pump
OUTPUT: TEMPORARY_OUTPUT
RASTERCOPY: /vsicurl/https://s3.eu-central-1.wasabisys.com/openlandmap/dtm/dtm.bareearth_ensemble_p10_30m_s_2018_go_epsg4326_v20230221.tif
Using ellipsoid: EPSG:7030
Using distance unit: meters
Using area unit: square meters
----------------
Results
----------------
OUTPUT: Sampled_57097dec_c7ca_433c_903d_12999a86fe92 |
However not working with a WCS example. Regarding the Played around with WCS, but with no success (contrary to the GUI operation). See below results. Now using another WCS than the one in the top post, since that one is dead. Extracted qgis_process command does not have
It gives the same error as before (Could not load source layer for RASTERCOPY). Also not working when changing to $ wget -q https://github.com/r-spatial/sf/raw/main/inst/gpkg/b_pump.gpkg
$
$ qgis_process run native:rastersampling --distance_units=meters --area_units=m2 --ellipsoid=EPSG:7030 --INPUT='b_pump.gpkg|layername=b_pump' --RASTERCOPY='/vsicurl/https://maps.isric.org/mapserv?map=/map/nitrogen.map&COVERAGEID=nitrogen_5-15cm_Q0.5' --COLUMN_PREFIX=SAMPLE_ --OUTPUT=TEMPORARY_OUTPUT
----------------
Inputs
----------------
COLUMN_PREFIX: SAMPLE_
INPUT: b_pump.gpkg|layername=b_pump
OUTPUT: TEMPORARY_OUTPUT
RASTERCOPY: /vsicurl/https://maps.isric.org/mapserv?map=/map/nitrogen.map&COVERAGEID=nitrogen_5-15cm_Q0.5
Using ellipsoid: EPSG:7030
Using distance unit: meters
Using area unit: square meters
ERROR: An error was encountered while checking parameter values
Could not load source layer for RASTERCOPY: /vsicurl/https://maps.isric.org/mapserv?map=/map/nitrogen.map&COVERAGEID=nitrogen_5-15cm_Q0.5 not found
$
$ qgis_process --version | head -1
QGIS 3.34.3-Prizren 'Prizren' (47373234acd) |
Same observations observed for:
|
Use the safer method of explicitly including the provider type when storing layer sources to string in more places, which eg fixes running the copied qgis_process string when a non gdal layer source is used for a raster layer. Also fixes the same situation when restoring an algorithm from the history log. Fixes qgis#54264
Use the safer method of explicitly including the provider type when storing layer sources to string in more places, which eg fixes running the copied qgis_process string when a non gdal layer source is used for a raster layer. Also fixes the same situation when restoring an algorithm from the history log. Fixes #54264
WCS appears to work now 🎉 Thanks!! 🙏 $ ~/git_repositories2/QGIS/build-8dc3558/output/bin/qgis_process run native:rastersampling --distance_units=meters --area_units=m2 --ellipsoid=EPSG:7030 --INPUT='/home/floris/b_pump.gpkg|layername=b_pump' --RASTERCOPY='wcs://cache=PreferNetwork&crs=EPSG:4326&dpiMode=7&format=GEOTIFF_INT16&identifier=nitrogen_0-5cm_Q0.5&tilePixelRatio=0&url=https://maps.isric.org/mapserv?map%3D/map/nitrogen.map%26COVERAGEID%3Dnitrogen_5-15cm_Q0.5' --COLUMN_PREFIX=SAMPLE_ --OUTPUT=TEMPORARY_OUTPUT
----------------
Inputs
----------------
COLUMN_PREFIX: SAMPLE_
INPUT: /home/floris/b_pump.gpkg|layername=b_pump
OUTPUT: TEMPORARY_OUTPUT
RASTERCOPY: wcs://cache=PreferNetwork&crs=EPSG:4326&dpiMode=7&format=GEOTIFF_INT16&identifier=nitrogen_0-5cm_Q0.5&tilePixelRatio=0&url=https://maps.isric.org/mapserv?map%3D/map/nitrogen.map%26COVERAGEID%3Dnitrogen_5-15cm_Q0.5
Using ellipsoid: EPSG:7030
Using distance unit: meters
Using area unit: square meters
proj_create_from_database: crs not found
proj_create_from_database: crs not found
proj_create_from_database: crs not found
Using non-preferred coordinate operation between and EPSG:4326. Using +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +step +proj=push +v_3 +step +proj=cart +ellps=airy +step +proj=helmert +x=446.448 +y=-125.157 +z=542.06 +rx=0.15 +ry=0.247 +rz=0.842 +s=-20.489 +convention=position_vector +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=unitconvert +xy_in=rad +xy_out=deg, preferred +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +step +proj=hgridshift +grids=uk_os_OSTN15_NTv2_OSGBtoETRS.tif +step +proj=unitconvert +xy_in=rad +xy_out=deg.
----------------
Results
----------------
OUTPUT: Sampled_2206186b_f5db_4b45_8ab5_f4b6ba03ef03
$
$ ~/git_repositories2/QGIS/build-8dc3558/output/bin/qgis_process --version
QGIS 3.35.0-Master 'Master' (8dc35588)
QGIS code revision 8dc35588
Qt version 5.15.3
Python version 3.10.12
GDAL/OGR version 3.8.3
PROJ version 9.3.1
EPSG Registry database version v10.098 (2023-11-24)
GEOS version 3.12.1-CAPI-1.18.1
SQLite version 3.37.2
OS Linux Mint 21.3 |
Use the safer method of explicitly including the provider type when storing layer sources to string in more places, which eg fixes running the copied qgis_process string when a non gdal layer source is used for a raster layer. Also fixes the same situation when restoring an algorithm from the history log. Fixes qgis#54264 (cherry picked from commit c3fa3af)
Use the safer method of explicitly including the provider type when storing layer sources to string in more places, which eg fixes running the copied qgis_process string when a non gdal layer source is used for a raster layer. Also fixes the same situation when restoring an algorithm from the history log. Fixes #54264 (cherry picked from commit c3fa3af)
Same issue here with:
trying to run the following which I copied out of QGIS GUI using advanced menu:
Note: I had to add the .bin as other wise I get 'Command --noversioncheck not known! Result is:
I will try QGIS 3.35 at somepoint. |
What is the bug or the crash?
When providing a remote layer as input argument – I tried both a WCS and a COG –
qgis_process
says it 'could not load source layer'. Below examples do work in the QGIS GUI though, as do the associated Pythonprocessing.run
commands in QGIS.Steps to reproduce the issue
Below
qgis_process
syntax was obtained by clicking 'Copy as qgis_process command' in the QGIS processing dialog.Versions
Supported QGIS version
New profile
Additional context
The COG file from OpenLandMap is documented at Zenodo. The WCS is documented by the Copernicus programme; see also GetCapabilities page.
The text was updated successfully, but these errors were encountered: