Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
added alternative db configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutjes, Dennis committed Mar 10, 2020
1 parent a7b6aa7 commit caa7385
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 1 addition & 2 deletions config/config_postgis_bgt_history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ Layers:
- SchemaName: bgt_wfs3_v1 #database schema name
TableName: bak #database table/view name
Identifier: bak #collection name in api response
Filter: (l."properties"->'eindRegistratie') is null
Description: BGT Bak #Description of the collection
GeometryColumn: _geom #column containing the SFS geometry
GeometryType: GEOMETRY # has currently no use
FeatureIDColumn: _id #the unique indexed identifier for a given feature
FeatureIDColumn: _version #the unique indexed identifier for a given feature
BBoxGeometryColumn: _bbox #extra column with bounding box selection index for intersects query, simplification and speedup
OffsetColumn: _offset_id # extra column to determine next keyset paging, should be numeric, indexed and unique, could be equal to feature id
BBox: [-285401.92, 22598.08, 595401.9199999999, 903401.9199999999] # Bounding box of all features can be used to display subset of features
Expand Down
14 changes: 14 additions & 0 deletions start.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ func main() {
crsMapFilePath := flag.String("crs", envString("PATH_CRS", ""), "crs file path")
configFilePath := flag.String("config", envString("PATH_CONFIG", ""), "configfile path")
connectionStr := flag.String("connection", envString("CONNECTION", "host=127.0.0.1 port=5432 database=bgt_v1 user=postgres password=postgres sslmode=disable"), "connection string postgis")
// alternative database configuration
if connectionStr == nil && *providerName == "postgis"{
withDBHost := flag.String("db-host", envString("DB_HOST", "bgt-cloud-db.postgres.database.azure.com"), "database host")
withDBPort := flag.Int("db-port", envInt("DB_PORT", 5432), "database port number")
WithDBName := flag.String("db-name", envString("DB_NAME", "pdok"), "database name")
withDBSSL := flag.String("db-ssl-mode", envString("DB_SSL_MODE", "disable"), "ssl-mode")
withDBUser := flag.String("db-user-name", envString("DB_USERNAME", "postgres"), "database username")
withDBPassword := flag.String("db-password", envString("DB_PASSWORD", ""), "database password")

connectionStrAlt := fmt.Sprintf("host=%s port=%d database=%s sslmode=%s user=%s password=%s",
*withDBHost, *withDBPort, *WithDBName, *withDBSSL, *withDBUser, *withDBPassword)

connectionStr = &connectionStrAlt
}

featureIdKey := flag.String("featureId", envString("FEATURE_ID", ""), "Default feature identification or else first column definition (fid)")

Expand Down

0 comments on commit caa7385

Please sign in to comment.