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

Commit caa7385

Browse files
author
Rutjes, Dennis
committed
added alternative db configuration
1 parent a7b6aa7 commit caa7385

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

config/config_postgis_bgt_history.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ Layers:
33
- SchemaName: bgt_wfs3_v1 #database schema name
44
TableName: bak #database table/view name
55
Identifier: bak #collection name in api response
6-
Filter: (l."properties"->'eindRegistratie') is null
76
Description: BGT Bak #Description of the collection
87
GeometryColumn: _geom #column containing the SFS geometry
98
GeometryType: GEOMETRY # has currently no use
10-
FeatureIDColumn: _id #the unique indexed identifier for a given feature
9+
FeatureIDColumn: _version #the unique indexed identifier for a given feature
1110
BBoxGeometryColumn: _bbox #extra column with bounding box selection index for intersects query, simplification and speedup
1211
OffsetColumn: _offset_id # extra column to determine next keyset paging, should be numeric, indexed and unique, could be equal to feature id
1312
BBox: [-285401.92, 22598.08, 595401.9199999999, 903401.9199999999] # Bounding box of all features can be used to display subset of features

start.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ func main() {
3434
crsMapFilePath := flag.String("crs", envString("PATH_CRS", ""), "crs file path")
3535
configFilePath := flag.String("config", envString("PATH_CONFIG", ""), "configfile path")
3636
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")
37+
// alternative database configuration
38+
if connectionStr == nil && *providerName == "postgis"{
39+
withDBHost := flag.String("db-host", envString("DB_HOST", "bgt-cloud-db.postgres.database.azure.com"), "database host")
40+
withDBPort := flag.Int("db-port", envInt("DB_PORT", 5432), "database port number")
41+
WithDBName := flag.String("db-name", envString("DB_NAME", "pdok"), "database name")
42+
withDBSSL := flag.String("db-ssl-mode", envString("DB_SSL_MODE", "disable"), "ssl-mode")
43+
withDBUser := flag.String("db-user-name", envString("DB_USERNAME", "postgres"), "database username")
44+
withDBPassword := flag.String("db-password", envString("DB_PASSWORD", ""), "database password")
45+
46+
connectionStrAlt := fmt.Sprintf("host=%s port=%d database=%s sslmode=%s user=%s password=%s",
47+
*withDBHost, *withDBPort, *WithDBName, *withDBSSL, *withDBUser, *withDBPassword)
48+
49+
connectionStr = &connectionStrAlt
50+
}
3751

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

0 commit comments

Comments
 (0)