lifewatch / eurobis

Loads data from EurOBIS into R and query on taxon, location and more
https://lifewatch.github.io/eurobis/
MIT License
1 stars 0 forks source link

paging=TRUE results in error: no layers in datasource #27

Closed johannow closed 10 months ago

johannow commented 10 months ago

I tried to download the following subset via the URL below: URL <- "https://geo.vliz.be/geoserver/Dataportal/wfs?version=1.1.0&request=GetFeature&typeName=eurobis-obisenv_basic&resultType=results&viewParams=where%3Adatasetid+IN+%283117%29+AND+%28%28observationdate+BETWEEN+%271990-01-01%27+AND+%272019-12-31%27+%29%29+AND+aphiaid+IN+%28+SELECT+aphiaid+FROM+eurobis.taxa_attributes+WHERE+selectid+IN+%28%27mammals%27%5C%2C%27pisces%27%29%29%3Bcontext%3A0100&propertyName=datasetid%2Cdatecollected%2Cdecimallatitude%2Cdecimallongitude%2Ccoordinateuncertaintyinmeters%2Cscientificname%2Caphiaid%2Cscientificnameaccepted&outputFormat=csv"

The code below works. test <- eurobis_occurrences_basic(url=URL)

However, trying the same with test <- eurobis_occurrences_basic(url=URL,paging=TRUE) always results in the following error: "Error: No layers in datasource." Trying different paging_length values does not make a difference.

bart-v commented 10 months ago

@salvafern : API or R code ...?

salvafern commented 10 months ago

Try with version=2.0 (See https://github.com/eblondel/ows4R/issues/70#issuecomment-1083194712)

johannow commented 10 months ago

wfs <- WFSClient$ new("https://geo.vliz.be/geoserver/Dataportal/wfs", "2.0.0", logger = "INFO")$ getCapabilities()$ findFeatureTypeByName("Dataportal:eurobis-obisenv_basic")

params <- "where%3A%28%28up.geoobjectsids+%26%26+ARRAY%5B2350%5D%29%29+AND+datasetid+IN+%28216%29%3Bcontext%3A0100%3Baphiaid%3A104464"

#with pagination system.time(feature_pagination <- wfs$getFeatures(viewParams = params, paging = TRUE, paging_length = 1000)) ` This results in the following error:

image

Also changing the "wfs?version=1.1.0" to "wfs?version=2.0.0" in the URL I mentioned before does not fix the issue.