Skip to content

Commit

Permalink
#29 specify data sql
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 22, 2019
1 parent 56a2cca commit ffcdb03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/geoflow_action_geosapi_publish_ogc_services.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ geosapi_publish_ogc_services <- function(entity, config, options){
if(entity$data$uploadType == "dbquery"){
vt <- GSVirtualTable$new()
vt$setName(entity$identifiers$id)
vt$setSql(datasource)
vt$setSql(entity$data$sql)
#if the virtual table is spatialized
if(!is.null(entity$data$geometryField) & !is.null(entity$data$geometryType)){
vtg <- GSVirtualTableGeometry$new(
Expand Down
11 changes: 11 additions & 0 deletions R/geoflow_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ geoflow_data <- R6Class("geoflow_data",
),
public = list(
source = NULL,
sql = NULL,
upload = TRUE,
uploadType = "other",
uploadZip = FALSE,
Expand Down Expand Up @@ -71,6 +72,11 @@ geoflow_data <- R6Class("geoflow_data",
}
self$setSource(data_props$source$values)

#sql
if(!is.null(data_props$sql)){
self$setSql(data_props$sql$values[[1]])
}

#layername (if any)
#not mandatory, can be used for subset layers
if(!is.null(data_props$layername)){
Expand Down Expand Up @@ -172,6 +178,11 @@ geoflow_data <- R6Class("geoflow_data",
self$source <- source
},

#setSql
setSql = function(sql){
self$sql <- sql
},

#setCqlFilter
setCqlFilter = function(cqlfilter){
self$cqlfilter <- cqlfilter
Expand Down

0 comments on commit ffcdb03

Please sign in to comment.