[GRASS-user] error when importing soil grids data into GRASS

Luí­s Moreira de Sousa luis.de.sousa at protonmail.ch
Mon Dec 13 03:54:32 PST 2021


Hi Vero,

in alternative you can use the WCS. A simple tool like wget is enough to query the server:

$ wget "https://maps.isric.org/mapserv?map=/map/nitrogen.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&COVERAGEID=nitrogen_5-15cm_Q0.5&FORMAT=GEOTIFF_INT16&SUBSET=X(-6535883,-6012080)&SUBSET=Y(-3921059,-3304244)&SUBSETTINGCRS=http://www.opengis.net/def/crs/EPSG/0/152160&OUTPUTCRS=http://www.opengis.net/def/crs/EPSG/0/152160" -O Uruguai_nit_5-15.tiff

--2021-12-13 12:42:56-- https://maps.isric.org/mapserv?map=/map/nitrogen.map&SERVICE=WCS&VERSION=2.0.1&REQUEST=GetCoverage&COVERAGEID=nitrogen_5-15cm_Q0.5&FORMAT=GEOTIFF_INT16&SUBSET=X(-6535883,-6012080)&SUBSET=Y(-3921059,-3304244)&SUBSETTINGCRS=http://www.opengis.net/def/crs/EPSG/0/152160&OUTPUTCRS=http://www.opengis.net/def/crs/EPSG/0/152160
Resolving maps.isric.org (maps.isric.org)... 137.224.206.3
Connecting to maps.isric.org (maps.isric.org)|137.224.206.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [image/tiff]
Saving to: ‘Uruguai_nit_5-15.tiff’

Uruguai_nit_5-15.tiff [ <=> ] 3,16M 5,62MB/s in 0,6s

2021-12-13 12:43:03 (5,62 MB/s) - ‘Uruguai_nit_5-15.tiff’ saved [3314780]

Then apply r.in.gdal directly:

> r.in.gdal input=Uruguai_nit_5-15.tiff output=uruguai_nit_5_15 -o
Over-riding projection check
Importing raster map <uruguai_nit_5_15>...
100%

You can request the result in a different CRS directly from the WCS. The GetCapabilities request informs you which are available. Although I would advise to work either on the original CRS or with another composed by an equal-area projection.

Best.

--
Luís

Sent with [ProtonMail](https://protonmail.com/) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, December 7th, 2021 at 6:11 PM, Veronica Andreo <veroandreo at gmail.com> wrote:

> Dear all,
>
> I'm trying to import soil grids data for south america into grass gis by means of r.import and the vsicurl driver and I'm facing different errors according to the soilgrid version I use. See below:
>
> Fist attempt:
>
> gdalinfo /vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/ocd_0-5cm_mean.vrt
> Driver: VRT/Virtual Raster
> Files: /vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/ocd_0-5cm_mean.vrt
> /vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/ocd_0-5cm_mean.vrt.ovr
> /vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/./ocd_0-5cm_mean/tileSG-018-027/tileSG-018-027_2-4.tif
> /vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/./ocd_0-5cm_mean/tileSG-018-027/tileSG-018-027_1-1.tif
> ...
> Size is 159246, 58034
> Coordinate System is:
> PROJCRS["Interrupted_Goode_Homolosine",
> BASEGEOGCRS["GCS_WGS_1984 ellipse",
> DATUM["World Geodetic System 1984",
> ELLIPSOID["WGS 84",6378137,298.257223563,
> LENGTHUNIT["metre",1]],
> ID["EPSG",6326]],
> PRIMEM["Greenwich",0,
> ANGLEUNIT["Degree",0.0174532925199433]]],
> CONVERSION["unnamed",
> METHOD["Interrupted Goode Homolosine"]],
> CS[Cartesian,2],
> AXIS["(E)",east,
> ORDER[1],
> LENGTHUNIT["metre",1,
> ID["EPSG",9001]]],
> AXIS["(N)",north,
> ORDER[2],
> LENGTHUNIT["metre",1,
> ID["EPSG",9001]]]]
>
> r.import input="/vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/ocd_0-5cm_mean.vrt" output=ocd_0_5cm_mean extent=region
> ...
> Selected PROJ pipeline:
> +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step
> +proj=igh +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84
> ************************
> Reproyectado primitivas...
> Construyendo topología para el mapa vectorial
> <tmp_r_import_region_localhost_localdomain_918305 at PERMANENT>...
> Registrando primitivas...
> Construyendo áreas.
> 100%
> Adjuntando islas...
> 100%
> Adjuntando centróides...
> 100%
> Importando mapa ráster <ocd_0_5cm_mean>...
> ERROR 4: `/vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/./ocd_0-5cm_mean/tileSG-022-030/tileSG-022-030_2-3.tif' not recognized as a supported file format.
> ERROR: Unable to read row 11740
> ERROR: Unable to import GDAL dataset
> </vsicurl/https://files.isric.org/soilgrids/latest/data/ocd/ocd_0-5cm_mean.vrt>
>
> Second attempt, newer dataset soilgrids 2.0 pre-release
>
> r.import input="/vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif" output=wv1500_0_5cm_mean extent=region
> Warning 1: /vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif: This file used to have optimizations in its layout, but those have been, at least partly, invalidated by later changes
> ADVERTENCIA: Actualizando el sistema de referencia espacial con la
> definición proj4 incrustada.
> ...
> Selected PROJ pipeline:
> +proj=pipeline +step +proj=unitconvert +xy_in=deg +xy_out=rad +step
> +proj=igh +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84
> ************************
> Reproyectado primitivas...
> Construyendo topología para el mapa vectorial
> <tmp_r_import_region_localhost_localdomain_918176 at PERMANENT>...
> Registrando primitivas...
> Construyendo áreas.
> 100%
> Adjuntando islas...
> 100%
> Adjuntando centróides...
> 100%
> Warning 1: /vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif: This file used to have optimizations in its layout, but those have been, at least partly, invalidated by later changes
> ADVERTENCIA: Actualizando el sistema de referencia espacial con la
> definición proj4 incrustada.
> Importando mapa ráster <wv1500_0_5cm_mean>...
> 100%
> Removiendo vector <tmp_r_import_region_localhost_localdomain_918176>
> Removiendo vector <tmp_r_import_region_localhost_localdomain_918176>
> Estimated target resolution for input band <wv1500_0_5cm_mean>:
> 0.0022003864773300253
> Reprojecting <wv1500_0_5cm_mean>...
> ADVERTENCIA: proj_create() failed for '(null)'
> ERROR: Unable to initialize coordinate transformation
> ERROR: Unable to to reproject raster <wv1500_0_5cm_mean>
>
> It imports the raster but fails at re-projection... CRS is unknown in the tif
>
> gdalinfo /vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif
> Warning 1: /vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif: This file used to have optimizations in its layout, but those have been, at least partly, invalidated by later changes
> Driver: GTiff/GeoTIFF
> Files: /vsicurl/https://storage.googleapis.com/isric-share-soilgrids/pre-release/wv1500/wv1500_0-5cm_mean.tif
> Size is 159246, 58034
> Coordinate System is:
> PROJCRS["unknown",
> BASEGEOGCRS["unknown",
> DATUM["World Geodetic System 1984",
> ELLIPSOID["WGS 84",6378137,298.257223563,
> LENGTHUNIT["metre",1]],
> ID["EPSG",6326]],
> PRIMEM["Greenwich",0,
> ANGLEUNIT["degree",0.0174532925199433],
> ID["EPSG",8901]]],
> CONVERSION["unknown",
> METHOD["Interrupted Goode Homolosine"],
> PARAMETER["Longitude of natural origin",0,
> ANGLEUNIT["degree",0.0174532925199433],
> ID["EPSG",8802]],
> ...
>
> Any suggestion? The second attempt seems a problem of the data provider not defining the CRS properly. But what about the first case, where the CRS is defined, any ideas on why the projection is not recognized? Any experience importing these data?
>
> Thanks much in advance!
> Vero
>
> My system info:
> Versión de GRASS: 8.0.dev
> Fecha de compilación: 2021-10-13
> GDAL: 3.2.2
> PROJ: 7.2.1
> GEOS: 3.9.0
> SQLite: 3.34.1
> Python: 3.9.7
> wxPython: 4.0.7
> Plataforma: Linux-5.14.9-200.fc34.x86_64-x86_64-with-glibc2.33
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20211213/423852f7/attachment-0001.html>


More information about the grass-user mailing list