Skip to content

Commit

Permalink
support #131
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 17, 2024
1 parent ffab53a commit 05a480c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ows4R
Version: 0.4-1
Date: 2024-12-09
Date: 2024-12-17
Title: Interface to OGC Web-Services (OWS)
Authors@R: c(person("Emmanuel", "Blondel", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-5870-5762")),
person("Alexandre", "Bennici", role = c("ctb"), comment = c(ORCID = "0000-0003-2160-3487")),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
**Enhancements**

- [#130](https://github.com/eblondel/ows4R/issues/130) WFS 2.0 - Support count parameter in case maxFeatures is used
- [#131](https://github.com/eblondel/ows4R/issues/131) WFS Add additional controls for WFS feature type validation

## [ows4R 0.4](https://github.com/eblondel/ows4R) | [![CRAN_Status_Badge](https://img.shields.io/badge/CRAN-published-blue.svg)](https://github.com/eblondel/ows4R)

Expand Down
17 changes: 10 additions & 7 deletions R/WFSFeatureType.R
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,18 @@ WFSFeatureType <- R6Class("WFSFeatureType",

#validating attributes vs. schema
if(validate) for(element in self$description){
attrName = element$getName()
attrType <- element$getType()
if(!is.null(attrType) && !element$isGeometry()){
attrName = element$getName()
if(!is.null(attrName) & !is.null(attrType) & !element$isGeometry()){
test = ftFeatures[[attrName]]
if(!is.null(ftFeatures[[attrName]])){
ftFeatures[[attrName]] <- switch(attrType,
"Date" = as.Date(ftFeatures[[attrName]]),
"POSIXct" = as.POSIXct(ftFeatures[[attrName]]),
as(ftFeatures[[attrName]], attrType)
)
if(attrType != "character"){
ftFeatures[[attrName]] <- switch(attrType,
"Date" = as.Date(ftFeatures[[attrName]]),
"POSIXct" = as.POSIXct(ftFeatures[[attrName]]),
as(ftFeatures[[attrName]], attrType)
)
}
}
}
}
Expand Down

0 comments on commit 05a480c

Please sign in to comment.