eblondel / ows4R

R Interface for OGC Web-Services (OWS)
https://eblondel.github.io/ows4R/
Other
37 stars 8 forks source link

OWSHttpRequest GET doesn't detect existing params and make GetCapabilities fail #112

Closed pobsteta closed 1 year ago

pobsteta commented 1 year ago

Hi, I want to connect to this WFS (https://www.datagrandest.fr/data4citizen/visualisation/api/?id=fr-120066022-jdd-352d8b8f-1307-49c2-8e9f-2894a1af4837&location=7,48.81277,5.80719&dataChart=eyJxdWVyaWVzIjpbeyJjb25maWciOnsiZGF0YXNldCI6ImZyLTEyMDA2NjAyMi1qZGQtMzUyZDhiOGYtMTMwNy00OWMyLThlOWYtMjg5NGExYWY0ODM3Iiwib3B0aW9ucyI6eyJpZCI6ImZyLTEyMDA2NjAyMi1qZGQtMzUyZDhiOGYtMTMwNy00OWMyLThlOWYtMjg5NGExYWY0ODM3In19LCJjaGFydHMiOlt7ImFsaWduTW9udGgiOnRydWUsInR5cGUiOiJjb2x1bW4iLCJmdW5jIjoiQVZHIiwieUF4aXMiOiJnbWxfaWQiLCJzY2llbnRpZmljRGlzcGxheSI6dHJ1ZSwiY29sb3IiOiIjNjZjMmE1In1dLCJ4QXhpcyI6ImdtbF9pZCIsIm1heHBvaW50cyI6NTAsInNvcnQiOiIifV0sInRpbWVzY2FsZSI6IiIsImRpc3BsYXlMZWdlbmQiOnRydWUsImFsaWduTW9udGgiOnRydWV9) with R ?

library(ows4R) # interface for OGC webservices

liens url vers reglements

wfs_z1 <- "https://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/5db9da6f-bab1-4cf0-a5a8-1024b5bd4f9f.internet.map" z1 <- WFSClient$new(wfs_z1, serviceVersion = "2.0.0") z1$getFeatureTypes(pretty = TRUE)

eblondel commented 1 year ago

@pobsteta it should be fixed now. Do you confirm it on your side?

pobsteta commented 1 year ago

Now i have this error

wfs_z1 <- "http://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/e098f26f-4cf4-437e-99d9-6b2f500eb4f7.internet.map" z1 <- WFSClient$new(wfs_z1, serviceVersion = "2.0.0") Error in if (nrow(namespace) == 0) { : argument is of length zero

eblondel commented 1 year ago

hum weird, make sure to restart well your R session (eventually Rstudio session) Also please retry adding logger DEBUG when creating the WFSClient:

z1 <- WFSClient$new(wfs_z1, serviceVersion = "2.0.0", logger = "DEBUG")

pobsteta commented 1 year ago

restart R and RStudio, reinstall ows4R and the same error on windows ?

pobsteta commented 1 year ago

z1 <- WFSClient$new(wfs_z1, serviceVersion = "2.0.0", logger = "DEBUG") [ows4R][INFO] OWSGetCapabilities - Fetching http://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/e098f26f-4cf4-437e-99d9-6b2f500eb4f7.internet.map?service=WFS&version=2.0.0&request=GetCapabilities -> GET /wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/e098f26f-4cf4-437e-99d9-6b2f500eb4f7.internet.map?service=WFS&version=2.0.0&request=GetCapabilities HTTP/1.1 -> Host: ogc.geo-ide.developpement-durable.gouv.fr -> User-Agent: libcurl/7.84.0 r-curl/5.0.2 httr/1.4.7 -> Accept-Encoding: deflate, gzip -> Cookie: SRV=bfa7847a-5406-4e50-b277-8eb799e6e3b1 -> Accept: application/json, text/xml, application/xml, / -> <- HTTP/1.1 301 Moved Permanently <- Date: Tue, 10 Oct 2023 13:24:44 GMT <- Server: Apache <- Location: https://ogc.geo-ide.developpement-durable.gouv.fr/wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/e098f26f-4cf4-437e-99d9-6b2f500eb4f7.internet.map?service=WFS&version=2.0.0&request=GetCapabilities <- Content-Length: 422 <- Content-Type: text/html; charset=iso-8859-1 <- -> GET /wxs?map=/opt/data/carto/geoide-catalogue/1.4/org_5443264/e098f26f-4cf4-437e-99d9-6b2f500eb4f7.internet.map?service=WFS&version=2.0.0&request=GetCapabilities HTTP/1.1 -> Host: ogc.geo-ide.developpement-durable.gouv.fr -> User-Agent: libcurl/7.84.0 r-curl/5.0.2 httr/1.4.7 -> Accept-Encoding: deflate, gzip -> Cookie: SRV=bfa7847a-5406-4e50-b277-8eb799e6e3b1 -> Accept: application/json, text/xml, application/xml, / -> <- HTTP/1.1 200 OK <- Date: Tue, 10 Oct 2023 13:24:43 GMT <- Server: Apache-Coyote/1.1 <- content-type: text/html <- Content-Encoding: gzip <- Vary: Accept-Encoding <- Content-Length: 312 <- Error in if (nrow(namespace) == 0) { : argument is of length zero

eblondel commented 1 year ago

How did you reinstall ows4R? try using remotes::install_github('eblondel/ows4R')

Sounds it is installing the past dev version

pobsteta commented 1 year ago

It'ok now, install fansi install failed first, now it's ok !

eblondel commented 1 year ago

Great!, i wait you do some more testing if you want, and i'll push right away a revision to CRAN for this fix. I've tested the getFeatures and it worked well. Cheers