Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jul 17, 2023
1 parent d8e43a0 commit 1f1a48f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions R/WFSFeatureType.R
Original file line number Diff line number Diff line change
Expand Up @@ -384,16 +384,20 @@ WFSFeatureType <- R6Class("WFSFeatureType",
}

#read features
ftFeatures <- switch(tolower(outputFormat),
"csv" = sf::st_read(destfile, quiet = TRUE,
options = c(
sprintf("GEOM_POSSIBLE_NAMES=%s", paste0(private$supportedGeomPossibleNames, collapse=",")),
sprintf("X_POSSIBLE_NAMES=%s", paste0(private$supportedXPossibleNames, collapse=",")),
sprintf("Y_POSSIBLE_NAMES=%s", paste0(private$supportedYPossibleNames, collapse=","))
)
),
sf::st_read(destfile, quiet = TRUE)
)
if(!is.null(outputFormat)){
ftFeatures <- switch(tolower(outputFormat),
"csv" = sf::st_read(destfile, quiet = TRUE,
options = c(
sprintf("GEOM_POSSIBLE_NAMES=%s", paste0(private$supportedGeomPossibleNames, collapse=",")),
sprintf("X_POSSIBLE_NAMES=%s", paste0(private$supportedXPossibleNames, collapse=",")),
sprintf("Y_POSSIBLE_NAMES=%s", paste0(private$supportedYPossibleNames, collapse=","))
)
),
sf::st_read(destfile, quiet = TRUE)
)
}else{
ftFeatures <- sf::st_read(destfile, quiet = TRUE)
}
if(self$hasGeometry()) if(self$getGeometryType() %in% colnames(ftFeatures)){
if(is.na(st_crs(ftFeatures))) st_crs(ftFeatures) <- self$getFeaturesCRS(obj)
if(is.na(st_crs(ftFeatures))) st_crs(ftFeatures) <- self$getDefaultCRS()
Expand Down

0 comments on commit 1f1a48f

Please sign in to comment.