eblondel / ows4R

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

error returned by wfs$getFeatures #27

Closed devineyfajr closed 5 years ago

devineyfajr commented 5 years ago

I can't share data or geoserver address, but basically everything seems to work up to the query for the simple feature: wfs = WFSClient$new(url=", serviceVersion="2.0.0", user="admin", pwd="geoserver") wfs$getCapabilities() wfs$getFeatureTypes(T)

get capabilities

caps <- wfs$getCapabilities()

find feature type

ft <- caps$findFeatureTypeByName("name1:name2", exact = TRUE)

both of these return same message

sf1 = ft$getFeatures("name1:name2", cql_filter="cell_id='608524524752732159'") sf1 = wfs$getFeatures("name1:name2", cql_filter="cell_id='609094538316742655'")

Error in CPL_read_ogr(dsn, layer, query, as.character(options), quiet, : NULL error in sfc_from_ogr

eblondel commented 5 years ago

Hi @devineyfajr , hard to debug without the URL example. If you can send it by email. Otherwise, there is something that miss in the cql_filter, you need to set it within URLencode. For the time being I didn't make it part of the function itself. This may be improved in a near future.

For the time being, do that:

sf1 = ft$getFeatures("name1:name2", cql_filter= URLencode("cell_id='608524524752732159'"))
devineyfajr commented 5 years ago

That didn't help. I'b going to try some different layers.

devineyfajr commented 5 years ago

That error was for a polygon layer. Point layers give a different error: Error in CPL_read_ogr(dsn, layer, query, as.character(options), quiet, : attempt to set index 2257/2257 in SET_STRING_ELT

The Store Type is Accumulo (Geomesa). I wonder if it could be that.

devineyfajr commented 5 years ago

Sorry, I can't do that. Thanks for your help anyway.

eblondel commented 5 years ago

Ok, so let's try in blind way:

devineyfajr commented 5 years ago

Switching to 1.0.0 worked. Didn't try 1.1.0. Cool.

eblondel commented 5 years ago

Great, you can try 1.1.0, it should work. On my side, I will run deeper tests on 2.0.0, to see if I detect issues with the geoservers I have under my umbrella. Best