Closed annakrystalli closed 2 years ago
Hi @annakrystalli yes, the problem starts within the WCS capabilities, that within this WCS version spec, at least through Geoserver (we would need to check), the Coverage Ids, are not identified with a ':' as namespace/layer identifier, but with a double underscore.
At now, the ows4R WCS client follows strictly what it finds in the capabilities, https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=2.0.1&request=GetCapabilities , meaning that if you try to search for emodnet__2018_st_All_avg_POSTER
it will find it, and you will be able to get its description. On the other hand, if you try emodnet:2018_st_All_avg_POSTER
, the capabilities doesn't list it so the layer is not found.
What geoserver does probably then at DescribeCoverage
request level, is to add a patch to make the latter layer name work, although it's not correct if you look at the get Capabilities.
I'm not against a patch to allow some flexibility on this, but first we would need to look into the standard, to understand what belongs to it, from what belongs to GeoServer patching.
Thanks for all the info! This might be something I can handle in EMODnetWCS package but might be useful for ows4r to handle natively if it makes sense. Should I find out what type of server the human activities one is?
It's a GeoServer. Let me see if I can add some "glue" to allow ":" or "__" namespace separator
OK, I've played around a bit and have some updates (see reprex below).
In summary:
getRange()
doesn't work, but accessing the rangeType
object of the description works. Is that how it should work?## Use __ namespace
## Version 1.1.1 (same with version 1.1.0)
library(ows4R)
#> Loading required package: geometa
#> Loading ISO 19139 XML schemas...
#> Loading ISO 19115 codelists...
#> Loading IANA mime types...
#> No encoding supplied: defaulting to UTF-8.
#> Loading required package: keyring
wcs1 <- WCSClient$new(url = "https://ows.emodnet-humanactivities.eu/wcs",
serviceVersion = "1.1.1",
logger = "DEBUG")
#> [ows4R][INFO] OWSGetCapabilities - Fetching https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=1.1.1&request=GetCapabilities
wcs1$describeCoverage("emodnet__2018_st_All_avg_POSTER")
#> [ows4R][INFO] WCSClient - Fetching coverageSummary description for 'emodnet__2018_st_All_avg_POSTER' ...
#> NULL
wcs1$getCapabilities()$findCoverageSummaryById("emodnet__2018_st_All_avg_POSTER", exact = TRUE)$getDescription()
#> Error in eval(expr, envir, enclos): attempt to apply non-function
## Version 2.0.1
wcs2 <- WCSClient$new(url = "https://ows.emodnet-humanactivities.eu/wcs",
serviceVersion = "2.0.1",
logger = "DEBUG")
#> [ows4R][INFO] OWSGetCapabilities - Fetching https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=2.0.1&request=GetCapabilities
wcs2$describeCoverage("emodnet__2018_st_All_avg_POSTER")
#> [ows4R][INFO] WCSClient - Fetching coverageSummary description for 'emodnet__2018_st_All_avg_POSTER' ...
#> [ows4R][INFO] WCSDescribeCoverage - Fetching https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=2.0.1&coverageId=emodnet__2018_st_All_avg_POSTER&request=DescribeCoverage
#> Loading required package: sf
#> Linking to GEOS 3.9.1, GDAL 3.4.0, PROJ 8.1.1; sf_use_s2() is TRUE
#> <WCSCoverageDescription>
#> ....|-- boundedBy <GMLEnvelope>
#> ........|-- lowerCorner: -623000 604000
#> ........|-- upperCorner: 6885000 7035000
#> ....|-- domainSet <GMLRectifiedGrid>
#> ........|-- limits <GMLElement>
#> ............|-- GridEnvelope <GMLElement>
#> ................|-- low <GMLElement>
#> ....................|-- value: 0 0
#> ................|-- high <GMLElement>
#> ....................|-- value: 7507 6430
#> ........|-- axisLabels <GMLElement>
#> ............|-- value: i j
#> ........|-- origin <GMLPoint>
#> ............|-- pos: -622500 7034500
#> ........|-- offsetVector <GMLElement>
#> ............|-- value: 1000.0 0.0
#> ........|-- offsetVector <GMLElement>
#> ............|-- value: 0.0 -1000.0
#> ....|-- coverageFunction <GMLGridFunction>
#> ........|-- sequenceRule <GMLElement>
#> ............|-- value: Linear
#> ........|-- startPoint <GMLElement>
#> ............|-- value: 0 0
#> ....|-- rangeType <GMLElement>
#> ........|-- DataRecord <GMLElement>
#> ............|-- field <GMLElement>
#> ................|-- Quantity <GMLElement>
#> ....................|-- description <GMLElement>
#> ........................|-- value: GRAY_INDEX
#> ....................|-- nilValues <GMLElement>
#> ........................|-- NilValues <GMLElement>
#> ............................|-- nilValue <GMLElement>
#> ................................|-- value: -3.4028234663852886E38
#> ....................|-- uom <GMLElement>
#> ....................|-- constraint <GMLElement>
#> ........................|-- AllowedValues <GMLElement>
#> ............................|-- interval <GMLElement>
#> ................................|-- value: -3.4028235E38 3.4028235E38
#> ....|-- metadata <GMLCOVExtension>
#> ........|-- Keywords <ISOElementSequence>
#> ............|-- Keyword: GeoTIFF
#> ........|-- Metadata[xlink:type=simple,xlink:href=https://www.emodnet.eu/geonetwork/emodnet/eng/csw?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=full&id=ccc4cd96-a838-4368-8a7f-9e2637a8b3ef&outputschema=http://www.isotc211.org/2005/gmd]
#> ....|-- CoverageId <GMLElement>
#> ........|-- value: emodnet__2018_st_All_avg_POSTER
#> ....|-- ServiceParameters <ISOElementSequence>
#> ........|-- CoverageSubtype: RectifiedGridCoverage
#> ........|-- nativeFormat: image/tiff
wcs2$getCapabilities()$findCoverageSummaryById("emodnet__2018_st_All_avg_POSTER", exact = TRUE)$getDescription()
#> <WCSCoverageDescription>
#> ....|-- boundedBy <GMLEnvelope>
#> ........|-- lowerCorner: -623000 604000
#> ........|-- upperCorner: 6885000 7035000
#> ....|-- domainSet <GMLRectifiedGrid>
#> ........|-- limits <GMLElement>
#> ............|-- GridEnvelope <GMLElement>
#> ................|-- low <GMLElement>
#> ....................|-- value: 0 0
#> ................|-- high <GMLElement>
#> ....................|-- value: 7507 6430
#> ........|-- axisLabels <GMLElement>
#> ............|-- value: i j
#> ........|-- origin <GMLPoint>
#> ............|-- pos: -622500 7034500
#> ........|-- offsetVector <GMLElement>
#> ............|-- value: 1000.0 0.0
#> ........|-- offsetVector <GMLElement>
#> ............|-- value: 0.0 -1000.0
#> ....|-- coverageFunction <GMLGridFunction>
#> ........|-- sequenceRule <GMLElement>
#> ............|-- value: Linear
#> ........|-- startPoint <GMLElement>
#> ............|-- value: 0 0
#> ....|-- rangeType <GMLElement>
#> ........|-- DataRecord <GMLElement>
#> ............|-- field <GMLElement>
#> ................|-- Quantity <GMLElement>
#> ....................|-- description <GMLElement>
#> ........................|-- value: GRAY_INDEX
#> ....................|-- nilValues <GMLElement>
#> ........................|-- NilValues <GMLElement>
#> ............................|-- nilValue <GMLElement>
#> ................................|-- value: -3.4028234663852886E38
#> ....................|-- uom <GMLElement>
#> ....................|-- constraint <GMLElement>
#> ........................|-- AllowedValues <GMLElement>
#> ............................|-- interval <GMLElement>
#> ................................|-- value: -3.4028235E38 3.4028235E38
#> ....|-- metadata <GMLCOVExtension>
#> ........|-- Keywords <ISOElementSequence>
#> ............|-- Keyword: GeoTIFF
#> ........|-- Metadata[xlink:type=simple,xlink:href=https://www.emodnet.eu/geonetwork/emodnet/eng/csw?service=CSW&version=2.0.2&request=GetRecordById&elementsetname=full&id=ccc4cd96-a838-4368-8a7f-9e2637a8b3ef&outputschema=http://www.isotc211.org/2005/gmd]
#> ....|-- CoverageId <GMLElement>
#> ........|-- value: emodnet__2018_st_All_avg_POSTER
#> ....|-- ServiceParameters <ISOElementSequence>
#> ........|-- CoverageSubtype: RectifiedGridCoverage
#> ........|-- nativeFormat: image/tiff
## getRange
wcs2$describeCoverage("emodnet__2018_st_All_avg_POSTER")$getRange()
#> [ows4R][INFO] WCSClient - Fetching coverageSummary description for 'emodnet__2018_st_All_avg_POSTER' ...
#> list()
wcs2$describeCoverage("emodnet__2018_st_All_avg_POSTER")$rangeType
#> [ows4R][INFO] WCSClient - Fetching coverageSummary description for 'emodnet__2018_st_All_avg_POSTER' ...
#> <GMLElement>
#> ....|-- DataRecord <GMLElement>
#> ........|-- field <GMLElement>
#> ............|-- Quantity <GMLElement>
#> ................|-- description <GMLElement>
#> ....................|-- value: GRAY_INDEX
#> ................|-- nilValues <GMLElement>
#> ....................|-- NilValues <GMLElement>
#> ........................|-- nilValue <GMLElement>
#> ............................|-- value: -3.4028234663852886E38
#> ................|-- uom <GMLElement>
#> ................|-- constraint <GMLElement>
#> ....................|-- AllowedValues <GMLElement>
#> ........................|-- interval <GMLElement>
#> ............................|-- value: -3.4028235E38 3.4028235E38
wcs2$getCapabilities()$findCoverageSummaryById("emodnet__2018_st_All_avg_POSTER", exact = TRUE)$getDescription()$getRange()
#> list()
wcs2$getCapabilities()$findCoverageSummaryById("emodnet__2018_st_All_avg_POSTER", exact = TRUE)$getDescription()$rangeType
#> <GMLElement>
#> ....|-- DataRecord <GMLElement>
#> ........|-- field <GMLElement>
#> ............|-- Quantity <GMLElement>
#> ................|-- description <GMLElement>
#> ....................|-- value: GRAY_INDEX
#> ................|-- nilValues <GMLElement>
#> ....................|-- NilValues <GMLElement>
#> ........................|-- nilValue <GMLElement>
#> ............................|-- value: -3.4028234663852886E38
#> ................|-- uom <GMLElement>
#> ................|-- constraint <GMLElement>
#> ....................|-- AllowedValues <GMLElement>
#> ........................|-- interval <GMLElement>
#> ............................|-- value: -3.4028235E38 3.4028235E38
Created on 2022-08-16 by the reprex package (v2.0.1)
With respect to range
and rangeType
, see my comments at https://github.com/eblondel/ows4R/issues/80#issuecomment-1210284745
@annakrystalli for usage matters, could you use the Discussion panel? in case there is a bug or feature request, we will convert it to ticket
describeCoverage
andgetDescription
don't seem to be working properly forhttps://ows.emodnet-humanactivities.eu/wcs
. Specifically I seem to get a truncatedWCSCoverageDescription
when using versions 1.1.1 & 1.1.0Created on 2022-08-09 by the reprex package (v2.0.1)
However, it seems the server does have CoverageDescription information, as can be seen from the response to the following request:
https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=1.1.1&identifiers=emodnet:2018_st_All_avg_POSTER&request=DescribeCoverage
Version 2.0.1
With version 2.0.1 I actually get nothing or an error
Created on 2022-08-09 by the reprex package (v2.0.1)
Version 2.0.1 is an accepted version though so should work no?
When I use
https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=2.0.1&identifiers=emodnet:2018_st_All_avg_POSTER&request=DescribeCoverage
I similarly get an error
but when I change to using
coverageId
to specify the coverage (https://ows.emodnet-humanactivities.eu/wcs?service=WCS&version=2.0.1&coverageId=emodnet:2018_st_All_avg_POSTER&request=DescribeCoverage
) again I get a fullcoverageDescription
Any ideas what might be going on?