eblondel / ows4R

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

WFS - add encoding facilities for cql_filter and filter params #46

Closed eblondel closed 4 years ago

eblondel commented 4 years ago

The purpose of this enhancement is to facilitate the use of filtering params in WFS:

wfs$getFeatures(cql_filter = "property = 'value'")

instead of

wfs$getFeatures(cql_filter = URLencode("property = 'value'"))

OGCFilter$new( PropertyIsEqualTo$new("property", "value") )

Encoding to xml requires $encode() to the filter. A user that wants to specify such a filter will have to encode it, coerce it to character and URL-encode it. This is too much, and all this should be done transparently by ows4R.

wfs$getFeatures(filter = OGCFilter$new( PropertyIsEqualTo$new("property", "value") ))

instead of

wfs$getFeatures(filter = URLencode(as(OGCFilter$new( PropertyIsEqualTo$new("property", "value") )$encode(), "character")))