Skip to content

Commit bd40f22

Browse files
authored
Merge pull request #88 from MapServer/pgsql
Improve Postgresql support with support than other schema to publish data
2 parents e9e02f8 + f27fb89 commit bd40f22

File tree

8 files changed

+52
-49
lines changed

8 files changed

+52
-49
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ OSM_NAME_COLUMN?=name
1818
OSM_SRID?=3857
1919
OSM_UNITS?=meters
2020
OSM_DB_CONNECTION?=host=localhost dbname=osm user=osm password=osm port=5432
21+
OSM_SCHEMA?=public
2122
OSM_EXTENT?=-20000000 -20000000 20000000 20000000
2223
OSM_FORCE_POSTGIS_EXTENT?=0
2324
OSM_WMS_SRS?=EPSG:900913 EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901 EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807 EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801 EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986 EPSG:3035
@@ -111,6 +112,7 @@ $(mapfile):$(template) $(includes)
111112
$(SED) 's/##.*$$//g' $(mapfile)
112113
$(SED) '/^ *$$/d' $(mapfile)
113114
$(SED) -e 's/OSM_PREFIX_/$(OSM_PREFIX)/g' $(mapfile)
115+
$(SED) -e 's/OSM_SCHEMA/$(OSM_SCHEMA)/g' $(mapfile)
114116
$(SED) -e 's/OSM_SRID/$(OSM_SRID)/g' $(mapfile)
115117
$(SED) -e 's/OSM_UNITS/$(OSM_UNITS)/g' $(mapfile)
116118
$(SED) -e 's/OSM_EXTENT/$(OSM_EXTENT)/g' $(mapfile)

buildings.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LAYER
1212
#if OSM_FORCE_POSTGIS_EXTENT == 1
1313
EXTENT OSM_EXTENT
1414
#endif
15-
DATA "geometry from (select geometry,osm_id, OSM_NAME_COLUMN as name from OSM_PREFIX_buildings) as foo using unique osm_id using srid=OSM_SRID"
15+
DATA "geometry from (select geometry,osm_id, OSM_NAME_COLUMN as name from OSM_SCHEMA.OSM_PREFIX_buildings) as foo using unique osm_id using srid=OSM_SRID"
1616
LABELITEM "name"
1717
PROCESSING "LABEL_NO_CLIP=ON"
1818
PROCESSING "CLOSE_CONNECTION=DEFER"

config.conf.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CONFIG
22
ENV
3-
##MS_MAP_PATTERN "^/etc/mapserver"
3+
MS_MAP_PATTERN "^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)"
44

55
#if _debug > 0 || _layerdebug > 0
66
MS_ERRORFILE "stderr"
@@ -9,7 +9,7 @@ CONFIG
99
PROJ_LIB _proj_lib
1010
END
1111
MAPS
12-
BASEMAPS "/etc/mapserver/osm-default.map"
12+
BASEMAPS "/etc/mapserver/osm-google.map"
1313
END
1414
END
1515

docker.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
OSM_DB_CONNECTION=host=postgis dbname=osm user=osm password=osm port=5432
2+
OSM_SCHEMA=prod
23
OSM_PREFIX=osm_
34
OSM_FORCE_POSTGIS_EXTENT=1
45
OSM_WMS_SRS=EPSG:900913 EPSG:4326 EPSG:3857 EPSG:28992

docker/imposm/import.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ for url in $PBF_FILES; do
3535
done
3636

3737
imposm import $OPTIONS -write
38-
imposm import $OPTIONS -deployproduction
38+
imposm import $OPTIONS --dbschema-production=prod -deployproduction

generate_style.py

Lines changed: 43 additions & 43 deletions
Large diffs are not rendered by default.

highways.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ LAYER
930930
#if OSM_FORCE_POSTGIS_EXTENT == 1
931931
EXTENT OSM_EXTENT
932932
#endif
933-
DATA "geometry from (select geometry, osm_id, type from OSM_PREFIX_aeroways) as foo using unique osm_id using srid=OSM_SRID"
933+
DATA "geometry from (select geometry, osm_id, type from OSM_SCHEMA.OSM_PREFIX_aeroways) as foo using unique osm_id using srid=OSM_SRID"
934934
CLASSITEM "type"
935935
CLASS
936936
EXPRESSION "runway"

landusage.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ LAYER
257257
#if OSM_FORCE_POSTGIS_EXTENT == 1
258258
EXTENT OSM_EXTENT
259259
#endif
260-
DATA "geometry from OSM_PREFIX_transport_areas using unique osm_id using srid=OSM_SRID"
260+
DATA "geometry from OSM_SCHEMA.OSM_PREFIX_transport_areas using unique osm_id using srid=OSM_SRID"
261261
PROCESSING "CLOSE_CONNECTION=DEFER"
262262
MAXSCALEDENOM _maxscale
263263
MINSCALEDENOM _minscale

0 commit comments

Comments
 (0)