-
Notifications
You must be signed in to change notification settings - Fork 11
/
gen_beschermdestadsdorpsgezichten.py
66 lines (51 loc) · 1.92 KB
/
gen_beschermdestadsdorpsgezichten.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
# Generates the beschermdestadsdorpsgezichten mapfile.
from generate import block, header, p, q
BSD_LONG = "Beschermde stads- en dorpsgezichten"
BSD_SHORT = "beschermdestadsdorpsgezichten"
layers = [
("Gemeentelijk beschermd stadsgezicht", "#00008b70"),
("Gemeentelijk beschermd dorpsgezicht", "#0000cd70"),
("Rijksbeschermd stadsgezicht", "#cd000070"),
("Rijksbeschermd dorpsgezicht", "#ff450070"),
]
header("SOEB")
with block("MAP"):
p("NAME", BSD_SHORT)
p("INCLUDE", "header.inc")
with block("WEB"):
with block("METADATA"):
q("ows_title", BSD_LONG)
q(
"ows_abstract",
"Kaart met gegevens over beschermde stads- en dorpsgezichten in de gemeente Amsterdam",
)
q("wms_extent", "100000 450000 150000 500000")
for name, color in layers:
with block("LAYER"):
p("NAME", name)
with block("PROJECTION"):
q("init=epsg:28992")
p("INCLUDE", "connection/dataservices.inc")
p(
"DATA",
f"geometry FROM public.{BSD_SHORT}_{BSD_SHORT} USING UNIQUE id USING srid=28992",
)
p("TYPE POLYGON")
with block("METADATA"):
q("wfs_enable_request", "!*")
q("wms_title", name)
q("wms_enable_request", "*")
q("wms_abstract", BSD_LONG)
q("wms_srs", "EPSG:28992")
q("wms_name", BSD_LONG)
q("wms_format", "image/png")
q("wms_server_version", "1.3.0")
q("wms_extent", "100000 450000 150000 500000")
p("LABELITEM", "status")
p("CLASSITEM", "status")
with block("CLASS"):
p("NAME", name)
p("EXPRESSION", name)
with block("STYLE"):
p("COLOR", color)