-
Notifications
You must be signed in to change notification settings - Fork 11
/
panorama.map
371 lines (345 loc) · 10.5 KB
/
panorama.map
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
#==============================================================================
#
# panorama.map
# doel: serveren van Panorama gegevens
#
#==============================================================================
#
# naam datum wijziging
# ------------------ ---------- -----------------------------------------
# S. Preeker 04-06-2016 schepping
#
#==============================================================================
MAP
NAME "Panoramas"
INCLUDE "header.inc"
WEB
METADATA
"ows_title" "Panoramas"
"ows_abstract" "Panorama opnamelocaties en trajecten"
END
END
LEGEND
STATUS ON
KEYSIZE 16 16
END
#=============================================================================
# LAYERS
#=============================================================================
LAYER
NAME "panorama_new"
GROUP "panorama opnamelocaties"
INCLUDE "connection/panorama.inc"
VALIDATION
# %timestamp_before% and %timestamp_after% substitutions
# are dates: 4 numbers, dash, 2 numbers,
# dash and 2 numbers.
# The default values should be reasonable
# lower and upper bounds.
"timestamp_before" "^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$"
"default_timestamp_before" "9999-12-31"
"timestamp_after" "^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$"
"default_timestamp_after" "0001-01-01"
# %mission_type% always is a lowercase string:
"mission_type" "^[a-z]*$"
"default_mission_type" ""
# %mission_year% always is a 4-number year:
"mission_year" "^[0-9]{4}$"
"default_mission_year" ""
END
DATA "geom FROM (SELECT id,
pano_id as display,
mission_year AS year,
roll,
pitch,
heading,
timestamp,
_geolocation_2d_rd AS geom,
'https://t1.data.amsterdam.nl/panorama/' || path || trim(trailing '.jpg' from filename) || '/equirectangular/panorama_8000.jpg' AS url,
'https://api.data.amsterdam.nl/panorama/panoramas/' || pano_id || '/' AS uri
-- Keep for future use:
-- (SELECT EXTRACT(year from MAX(timestamp)) FROM panoramas_panorama LIMIT 1) -
-- EXTRACT(year from timestamp) AS age
FROM public.panoramas_panorama pano
WHERE
NOT EXISTS (
SELECT *
FROM public.panoramas_panorama newer
WHERE
pano.id != newer.id AND
pano.surface_type = newer.surface_type AND
(
length('%mission_type%') = 0 OR
'%mission_type%' = lower(newer.mission_type)
) AND
(
length('%mission_year%') = 0 OR
NULLIF('%mission_year%', '')::int = newer.mission_year
) AND
'[%timestamp_after%, %timestamp_before%]'::tstzrange @> timestamp AND
newer.timestamp > pano.timestamp AND
newer.status = 'done' AND
-- Substract 0.7m from mission_distance to prevent panorama photos from one mission/trajectory
-- canceling each other
ST_DWithin(newer._geolocation_2d_rd, pano._geolocation_2d_rd, pano.mission_distance - 0.7) AND
ST_Intersects(
newer._geolocation_2d_rd,
ST_Buffer(ST_Transform(!BOX!, 28992), pano.mission_distance)
)
) AND
(
length('%mission_type%') = 0 OR
'%mission_type%' = lower(mission_type)
) AND
(
length('%mission_year%') = 0 OR
NULLIF('%mission_year%', '')::int = mission_year
) AND
ST_Intersects(
pano._geolocation_2d_rd,
ST_Transform(!BOX!, 28992)
) AND
'[%timestamp_after%, %timestamp_before%]'::tstzrange @> timestamp
AND
pano.status = 'done'
) AS subquery
USING srid=28992 USING UNIQUE id"
TYPE POINT
MINSCALEDENOM 100
MAXSCALEDENOM 10001
TEMPLATE "fooOnlyForWMSGetFeatureInfo.html"
FILTER ("True")
PROJECTION
"init=epsg:28992"
END
METADATA
"ows_title" "panorama_new"
"ows_group_title" "recente panorama's"
"ows_abstract" "recente panorama's"
"gml_featureid" "id"
"gml_include_items" "all"
"gml_types" "auto"
END
COMPOSITE
OPACITY 70
END
CLASS
NAME "2022"
EXPRESSION ([year] eq 2022)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 153 0 153
OUTLINECOLOR 229 0 130
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 153 0 153
OUTLINECOLOR 229 0 130
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 153 0 153
OUTLINECOLOR 229 0 130
WIDTH 1
END
END
CLASS
NAME "2021"
EXPRESSION ([year] eq 2021)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 255 184 224
OUTLINECOLOR 229 0 130
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 255 184 224
OUTLINECOLOR 229 0 130
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 255 184 224
OUTLINECOLOR 229 0 130
WIDTH 1
END
END
CLASS
NAME "2020"
EXPRESSION ([year] eq 2020)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 177 217 245
OUTLINECOLOR 0 126 197
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 177 217 245
OUTLINECOLOR 0 126 197
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 177 217 245
OUTLINECOLOR 0 126 197
WIDTH 1
END
END
CLASS
NAME "2019"
EXPRESSION ([year] eq 2019)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 0 104 39
OUTLINECOLOR 0 46 17
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 0 104 39
OUTLINECOLOR 0 46 17
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 0 104 39
OUTLINECOLOR 0 46 17
WIDTH 1
END
END
CLASS
NAME "2018"
EXPRESSION ([year] eq 2018)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 0 160 60
OUTLINECOLOR 0 112 11
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 0 160 60
OUTLINECOLOR 0 112 11
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 0 160 60
OUTLINECOLOR 0 112 11
WIDTH 1
END
END
CLASS
NAME "2017"
EXPRESSION ([year] eq 2017)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 190 210 0
OUTLINECOLOR 137 161 0
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 190 210 0
OUTLINECOLOR 137 161 0
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 190 210 0
OUTLINECOLOR 137 161 0
WIDTH 1
END
END
CLASS
NAME "2016"
EXPRESSION ([year] eq 2016)
STYLE
MINSCALEDENOM 100
MAXSCALEDENOM 1001
SYMBOL 'stip'
SIZE 10
COLOR 233 227 130
OUTLINECOLOR 176 171 87
WIDTH 1
END
STYLE
MINSCALEDENOM 1002
MAXSCALEDENOM 4001
SYMBOL 'stip'
SIZE 6
COLOR 233 227 130
OUTLINECOLOR 176 171 87
WIDTH 1
END
STYLE
MINSCALEDENOM 4002
MAXSCALEDENOM 10001
SYMBOL 'stip'
SIZE 3
COLOR 233 227 130
OUTLINECOLOR 176 171 87
WIDTH 1
END
END
END
#-----------------------------------------------------------------------------
END