MapRestServiceApi » History » Version 52
Andreas Kohlbecker, 10/21/2013 05:21 PM
1 | 1 | Andreas Kohlbecker | |
---|---|---|---|
2 | 2 | Andreas Kohlbecker | |
3 | 1 | Andreas Kohlbecker | |
4 | 8 | Andreas Kohlbecker | |
5 | # Map REST Service |
||
6 | 1 | Andreas Kohlbecker | |
7 | |||
8 | |||
9 | 12 | Andreas Kohlbecker | ---- |
10 | |||
11 | _This is not a specification of a publicly available service but a proposal and guidance for the implementation of next version of the EDIT Map Service_ |
||
12 | |||
13 | 1 | Andreas Kohlbecker | |
14 | 35 | Andreas Kohlbecker | _The next version of the EDIT Map Service is being discussed on [[MapRestServiceApi_20_Discussion|MapRestServiceApi 2.0 Discussion]]_ |
15 | 34 | Andreas Kohlbecker | |
16 | |||
17 | 1 | Andreas Kohlbecker | ---- |
18 | 21 | Niels Hoffmann | |
19 | |||
20 | {{>toc}} |
||
21 | |||
22 | 12 | Andreas Kohlbecker | |
23 | |||
24 | |||
25 | 20 | Andreas Kohlbecker | ## Servers |
26 | |||
27 | |||
28 | The map services are currently available from the following servers: |
||
29 | |||
30 | |||
31 | 29 | Franck Theeten | * http://edit.br.fgov.be/edit_wp5. |
32 | |||
33 | |||
34 | 32 | Franck Theeten | There are 3 available scripts : |
35 | 29 | Franck Theeten | |
36 | |||
37 | |||
38 | |||
39 | 33 | Franck Theeten | * "areas.php" (dev. from 2007): displaying maps with areas (polygons) having a color theme dynamically defined by HTTP GET or POST parameters. Output in json format is also available. |
40 | 29 | Franck Theeten | |
41 | |||
42 | |||
43 | 33 | Franck Theeten | * "points.php" (dev. from 2007): displaying maps with points for occurrence data. Position, legend and symbology of the points can be dynamically defined by HTTP parameters. Output in JSON format is also available. |
44 | 29 | Franck Theeten | |
45 | |||
46 | |||
47 | 31 | Franck Theeten | * [rest_gen.php" (developped from May 2011): Merging "areas.php" and "points.php]() color theme both for areas (polygons) and distribution points. Output in JSON format is also available. |
48 | 29 | Franck Theeten | |
49 | |||
50 | Version used by most of users (May 2011): |
||
51 | |||
52 | |||
53 | |||
54 | * http://edit.br.fgov.be/edit_wp5/v1/points.php |
||
55 | |||
56 | |||
57 | |||
58 | * http://edit.br.fgov.be/edit_wp5/v1/areas.php |
||
59 | |||
60 | |||
61 | |||
62 | 1 | Andreas Kohlbecker | * http://edit.br.fgov.be/edit_wp5/v1/rest_gen.php |
63 | 29 | Franck Theeten | |
64 | |||
65 | 30 | Franck Theeten | |
66 | Frozen versions (20th of May 2011): |
||
67 | 29 | Franck Theeten | |
68 | |||
69 | |||
70 | |||
71 | * http://edit.br.fgov.be/edit_wp5/v1.1/points.php |
||
72 | |||
73 | |||
74 | |||
75 | * http://edit.br.fgov.be/edit_wp5/v1.1/areas.php |
||
76 | |||
77 | |||
78 | |||
79 | * http://edit.br.fgov.be/edit_wp5/v1.1/rest_gen.php |
||
80 | 20 | Andreas Kohlbecker | |
81 | |||
82 | 12 | Andreas Kohlbecker | |
83 | 1 | Andreas Kohlbecker | ## Introduction |
84 | |||
85 | |||
86 | 3 | Andreas Kohlbecker | The EDIT Map Service returns map images in response to a URL. Distribution and occurrence maps can be generated. |
87 | 1 | Andreas Kohlbecker | |
88 | 15 | Andreas Kohlbecker | Each map is specified by attributes (URL query parameters) or in future by configuration files whose location is given by attributes to the service, which in turn will load the files to process them. |
89 | 1 | Andreas Kohlbecker | |
90 | 5 | Andreas Kohlbecker | These configuration files are not Geoserver/WMS config files. These files are an alternative way to submit settings for a map to the wms wrapper. For example you can specify areas as described below or you tell the service from where it can download a file which contains all the area definitions. Practical exampls of URI requests to a EDIT Map Service are found on [[MapRestServiceExamples|Map REST Service Examples]]. |
91 | 12 | Andreas Kohlbecker | |
92 | |||
93 | Some parts and features of this REST API is still in a creative process these considerations and thoughts are collected and discussed in [[MapRestServiceIdeas]]. |
||
94 | 1 | Andreas Kohlbecker | |
95 | |||
96 | |||
97 | ## Conventions and general considerations |
||
98 | |||
99 | |||
100 | 3 | Andreas Kohlbecker | The EDIT Map Service is a service wrapping around a WMS geoserver. wms query parameters can be used in addition to the API attributes defined here. The wrapper internally construct the WMS GetMap request from the REST API attributes. |
101 | 1 | Andreas Kohlbecker | |
102 | |||
103 | The request URIs must conform to [RFC 3986](http://tools.ietf.org/html/rfc3986.) |
||
104 | |||
105 | |||
106 | 3 | Andreas Kohlbecker | The EDIT Map Service ignores wms attributes if a substitute is defined in this specification, e.g.: |
107 | 1 | Andreas Kohlbecker | |
108 | |||
109 | 19 | Andreas Müller | * **request=!GetMap** - not needed |
110 | 1 | Andreas Kohlbecker | |
111 | * **Format ** - optional (need to define default : png?) |
||
112 | |||
113 | * **bbox ** - required! |
||
114 | |||
115 | * **width, height** - replaced by **ms** |
||
116 | |||
117 | * **layers ** - replaced by **l** optional |
||
118 | |||
119 | * **SRS ** - (Spatial Reference System (SRS) identifier ) optional ( Defines projections in WMS GetMap request. Using EPSG:4326 (WGS84 lat/long) is the default but can be changed on-the-fly to different UTM and much more zone specific.) |
||
120 | |||
121 | |||
122 | In attribute names the following letters are used as abbreviations for: |
||
123 | |||
124 | |||
125 | * d: data |
||
126 | |||
127 | * s: style / size |
||
128 | |||
129 | * a: area |
||
130 | |||
131 | * r: resolution |
||
132 | |||
133 | * g: grid |
||
134 | |||
135 | * o: occurrence |
||
136 | |||
137 | * c: cell |
||
138 | |||
139 | * l: layer |
||
140 | |||
141 | * m: map image |
||
142 | |||
143 | |||
144 | Since there is a size limitation for URLs the API syntax is soze optimizes where possible. This is mainly achieved by avoiding redundancies and could be further improved by reducing the need for separators. |
||
145 | |||
146 | |||
147 | |||
148 | ### Reserved Characters |
||
149 | |||
150 | |||
151 | The colon ':' is used as delimiter between a leading identifier and the data, style ... |
||
152 | |||
153 | |||
154 | The semi-colon ";" is always used as delimiter between entries of the same data type. |
||
155 | |||
156 | |||
157 | The comma "," character delimits the sub-entries of which a singel entry can be composed (e.g: <longitude>,<latitude>). |
||
158 | |||
159 | |||
160 | Data entities of different types which together specifiy a character out of a matrix (or tree) of possible characters are delimited by the dash "/" (e.g: <shape>/<size>/<color>). |
||
161 | |||
162 | |||
163 | There is no delimiter to concatenate multiple lists of entries into a single attribute. In this case the same attribute is used multiple time in the request URI, every time assigned to another set of entries ( e.g.: @od=1:38.326,-0.822;38.328,-0.542&od=3:40.78,-4.009;43.461,-5.412@). |
||
164 | |||
165 | |||
166 | |||
167 | ### Syntax Definition |
||
168 | |||
169 | |||
170 | 22 | Andreas Kohlbecker | The grammar definition which is adapted from the [Backus-Naur Form (BNF)](http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form) is using the following characters: |
171 | 1 | Andreas Kohlbecker | |
172 | |||
173 | Brackets "[]" are used to enclose optional attributes. |
||
174 | |||
175 | |||
176 | Angles "<>" are used to enclose data component names. |
||
177 | |||
178 | |||
179 | 22 | Andreas Kohlbecker | The expressions "[[]"|and "[;..]]" indicate that the preceding element can be repeated multiples times using the particular delimiter. |
180 | 1 | Andreas Kohlbecker | |
181 | |||
182 | 22 | Andreas Kohlbecker | The pipe character "|" is being used to separate optional entries. |
183 | 1 | Andreas Kohlbecker | |
184 | 22 | Andreas Kohlbecker | |
185 | |||
186 | 9 | Andreas Kohlbecker | ## Map Services |
187 | 1 | Andreas Kohlbecker | |
188 | |||
189 | 9 | Andreas Kohlbecker | There are two different services which are used for creating maps. One service for creating maps and another one being responsible for creating the legends. The map created by the map service can directly include legends in which case the map service is using the legend service internally. The services are registered to the following URI sub paths: |
190 | 1 | Andreas Kohlbecker | |
191 | |||
192 | 10 | Andreas Kohlbecker | * map service: @ ./map/ @ |
193 | 1 | Andreas Kohlbecker | |
194 | 10 | Andreas Kohlbecker | * legend service: @ ./legend/ @ |
195 | 1 | Andreas Kohlbecker | |
196 | |||
197 | |||
198 | |||
199 | 10 | Andreas Kohlbecker | |
200 | ## Layers |
||
201 | |||
202 | |||
203 | 9 | Andreas Kohlbecker | For wms areas are specified in shape files (polygons in *.shp + area index in *.shx). |
204 | 1 | Andreas Kohlbecker | |
205 | 10 | Andreas Kohlbecker | |
206 | 1 | Andreas Kohlbecker | The map service offers a set of default raster data and shape files e.g. for all 4 TDWG regions, ISO regions etc. |
207 | 9 | Andreas Kohlbecker | |
208 | 10 | Andreas Kohlbecker | |
209 | 1 | Andreas Kohlbecker | These predefined layers can be selected by the layer name, e.g. tdwg1 for TDWG regions level 1. |
210 | |||
211 | |||
212 | 9 | Andreas Kohlbecker | **Attribute:** |
213 | 10 | Andreas Kohlbecker | |
214 | 1 | Andreas Kohlbecker | |
215 | 10 | Andreas Kohlbecker | |
216 | ~~~ |
||
217 | 22 | Andreas Kohlbecker | (layer) l=<layer name>[:[<layer style id>][<shp file url>|<raster data url>]];... |
218 | 1 | Andreas Kohlbecker | ~~~ |
219 | |||
220 | 13 | Andreas Kohlbecker | The (layer) "l" attribute is an facultative one it is not needed if only predefined layers are used for a map. |
221 | |||
222 | |||
223 | 1 | Andreas Kohlbecker | Multiple layer definitions are separated by dash characters. |
224 | |||
225 | |||
226 | Where |
||
227 | |||
228 | * `<layer name>` is the name of either a default shape file offered by the server or a new name. |
||
229 | |||
230 | * `<layer style id>` is the identifier of a layerstyle |
||
231 | |||
232 | |||
233 | The order of <layer name> parameters in the attribute specifies the order of the layer stack for the map image from bottom to top. Raster data must be the first on the list, otherwise you cannot see vector layers. |
||
234 | |||
235 | |||
236 | In the latter case the optional attribute `<shp file url>` must be given to specify a *.shp file to processed by the server. The name of the also required *.shx (index-) file is inferred from @<shp file url>@. |
||
237 | |||
238 | |||
239 | 11 | Andreas Kohlbecker | **Available Layers (<layer name>)** |
240 | |||
241 | |||
242 | 24 | Andreas Müller | * tdwg1 ([overview](http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:tdwg_level_1&styles=&bbox=-180.0,-90.0,180.0,83.624&width=684&height=330&srs=EPSG:4326&format=application/openlayers)) |
243 | 11 | Andreas Kohlbecker | |
244 | 24 | Andreas Müller | * tdwg2 ([overview](http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:tdwg_level_2&styles=&bbox=-180.0,-90.0,180.0,83.624&width=684&height=330&srs=EPSG:4326&format=application/openlayers)) |
245 | 11 | Andreas Kohlbecker | |
246 | 24 | Andreas Müller | * tdwg3 ([overview](http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:tdwg_level_3&styles=&bbox=-180.0,-90.0,180.0,83.624&width=684&height=330&srs=EPSG:4326&format=application/openlayers)) |
247 | 11 | Andreas Kohlbecker | |
248 | 24 | Andreas Müller | * tdwg4 ([overview](http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:tdwg_level_4&styles=&bbox=-180.0,-90.0,180.0,83.624&width=684&height=330&srs=EPSG:4326&format=application/openlayers)) |
249 | 11 | Andreas Kohlbecker | |
250 | 23 | Franck Theeten | * earth |
251 | 11 | Andreas Kohlbecker | |
252 | 36 | Franck Theeten | * e_provinces |
253 | |||
254 | 37 | Franck Theeten | * several vmap0 layers (http://en.wikipedia.org/wiki/Vector_Map http://gis-lab.info/qa/vmap0-eng.html) |
255 | 1 | Andreas Kohlbecker | |
256 | 37 | Franck Theeten | |
257 | 38 | Franck Theeten | ~~~ |
258 | currently (8/8/2011) there are 76 vmap0 layers in the EDIT Geoserver WMS. |
||
259 | They are (roughly) divided in 4 zones: |
||
260 | * Europe (layers beginning with 'vmap0_eu' in the EDIT WMS) |
||
261 | * Asia and Oceania (layers beginning with 'vmap0_as' in the EDIT WMS |
||
262 | * Africa and South America (layers beginning with 'vmap0_afsa' in the EDIT WMS) |
||
263 | * North America (layers beginning with 'vmap0_na' in the EDIT WMS) |
||
264 | ~~~ |
||
265 | * The complete European dataset has been imported, with political (borders of countries and national subdivisions (like Belgian and Dutch Provinces, French Regions, German Landers, Italian regions Swiss Canton etc...) layers, |
||
266 | |||
267 | ecological layers (soil, rivers, vegetation}, layers on infrastructure and habitat (urban areas, roads, railways) etc... |
||
268 | |||
269 | * Only parts of the information have been imported for the 3 other zones , but they all features at least the political boundaries: |
||
270 | |||
271 | * Europe: http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:vmap0_eur_bnd_political_boundary_a&styles=&bbox=-31.266,30.0,180.0,81.857&width=1344&height=330&srs=EPSG:4326&format=application/openlayers |
||
272 | |||
273 | * Asia and Oceania: http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:vmap0_na_bnd_political_boundary_a&styles=&bbox=-180.0,-30.531,-7.921,83.627&width=512&height=339&srs=EPSG:4326&format=application/openlayers |
||
274 | |||
275 | * Africa and South America: http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:vmap0_afsa_bnd_political_boundary_a&styles=&bbox=-180.0,-30.531,-7.921,83.627&width=512&height=339&srs=EPSG:4326&format=application/openlayers |
||
276 | |||
277 | * North America: http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=topp:vmap0_na_bnd_political_boundary_a&styles=&bbox=-180.0,-30.531,-7.921,83.627&width=512&height=339&srs=EPSG:4326&format=application/openlayers |
||
278 | |||
279 | |||
280 | The provinces are named and retrievable through "GetFeature" WMS queries. |
||
281 | |||
282 | |||
283 | * -It is possible to ask for more layers as the complete Vmap0 has been loaded into the PostGIS database feeding the EDIT WMS. |
||
284 | |||
285 | |||
286 | * -It is also possible to aggregate together several layers in oen alias with one specific style, but this operation is tedious as it requires the manual configuration of several SLD files: |
||
287 | |||
288 | |||
289 | |||
290 | * e.g: http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=vmap0_world_basic&styles=&bbox=-180.0,-90.0,180.0,90.0&width=660&height=330&srs=EPSG:4326&format=application/openlayers |
||
291 | |||
292 | |||
293 | * -An aggregate layer of all the national subdivisions of the world is available. |
||
294 | |||
295 | |||
296 | * Its name is "*vmap0_world_national_boundaries*" |
||
297 | |||
298 | http://edit.br.fgov.be:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=vmap0_world_national_boundaries&styles=&bbox=-180.0,-90.0,180.0,83.627&width=684&height=330&srs=EPSG:4326&format=application/openlayers |
||
299 | |||
300 | |||
301 | |||
302 | |||
303 | |||
304 | |||
305 | |||
306 | ---- |
||
307 | |||
308 | 11 | Andreas Kohlbecker | |
309 | 1 | Andreas Kohlbecker | |
310 | 38 | Franck Theeten | For a complete list of currently available layers see [geoserver layer preview](http://edit.br.fgov.be:8080/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage) |
311 | 25 | Andreas Müller | |
312 | |||
313 | 27 | Andreas Müller | **Layer styles** |
314 | |||
315 | |||
316 | 1 | Andreas Kohlbecker | Layer styles are defined by the layer_style attribute |
317 | |||
318 | |||
319 | ~~~ |
||
320 | (layer style) ls=<layer_style_id>:[<line_color>][/<line_width>][/<stroke_style_id>];.. |
||
321 | ~~~ |
||
322 | |||
323 | Where |
||
324 | |||
325 | * `layer_style_id` is the layers identifier |
||
326 | |||
327 | * `line_color` is the color of border lines used in the layer |
||
328 | |||
329 | * `line_width` is the width of the border lines |
||
330 | |||
331 | * `stroke_style_id` is an id for the stroke (still to be defined) |
||
332 | 11 | Andreas Kohlbecker | |
333 | 1 | Andreas Kohlbecker | |
334 | |||
335 | |||
336 | > [Pere] |
||
337 | |||
338 | > Shapefiles is the ESRI (propietary) format for storing vector data. The most performant way of storing areas are in postGIS database. |
||
339 | |||
340 | > We could insert the .shp in postGIS and try to “inform†Geoserver of this new layer... something like this has been done before but it can be complicated. |
||
341 | |||
342 | > |
||
343 | |||
344 | |||
345 | > Another issue is to insert information (CSV files or whatever, even shapefile) in an already existing postGIS database (as the table already exists and is defined in Geoserver, we just need an userid filter to get the data we just have inserted now; this is the technique used in mapViewer to filter the CSV data you insert). |
||
346 | |||
347 | > |
||
348 | |||
349 | >> [[Andreas|K]] So the solution could be like the following: |
||
350 | |||
351 | >> - We allow for example 20 extra layers as postGIS tables |
||
352 | |||
353 | >> - Shapefiles (or GML?) are inserted by shp2pgsql into one of the postGIS tables |
||
354 | |||
355 | >> - An md5 hash of the according URL parameter token ( <layer name>[[<shp|file url>]][[<raster|data url>]] ) is used as key to identify, i.e. to filter the shapes for this layer definition for the geoserver. Otherwise 1) you would have to add a URL queryparameter user=<username> |
||
356 | |||
357 | |||
358 | |||
359 | ## Areas |
||
360 | |||
361 | |||
362 | 23 | Franck Theeten | *A.Attribute (for all layers)*: |
363 | 1 | Andreas Kohlbecker | |
364 | ~~~ |
||
365 | 23 | Franck Theeten | (area data) ad=<layer name>:<field name>:<area set>[;..] |
366 | <area set> ::= <area style ids>:<area id list> |
||
367 | <area id list> ::= <area id>[,..] |
||
368 | ~~~ |
||
369 | |||
370 | Where |
||
371 | |||
372 | |||
373 | * `<field name>` is the name of the field in the WMS layer that contains the <area style ids> |
||
374 | |||
375 | * `<area style ids>` is a string of one letter `[a-z,A-Z]` area style ids |
||
376 | |||
377 | * `<area id>` either is the shape index as defined in the *.shx file or a area name. Area names are internally translated by the service ito shape index. |
||
378 | |||
379 | |||
380 | e.g: |
||
381 | |||
382 | http://edit.br.fgov.be/edit_wp5/v1//areas.php?l=cyprusdivs&ad=cyprusdivs:bdcode:a:4|b:2|c:8&as=a:000000~0.1|b:~0.1|c:000000~0.1&title=a%3ACasual%3F|b%3Anaturalised|c%3AIndigenous&l=tdwg4&ad=cyprusdivs:bdcode:a:4|b:2|c:8&as=a:000000~0.1|b:~0.1|c:000000~0.1&title=a:Casual%3F|b:naturalised|c:Indigenous&img=false&ms=500&bbox=32,34,35,36&labels=1&img=true&ms=500&img=true&legend=1&mlp=3&mc_s=Georgia,15,blue&mc=&recalculate=false |
||
383 | |||
384 | |||
385 | |||
386 | *B.Attribute (optional for precoded TDWG layers)*: |
||
387 | |||
388 | ~~~ |
||
389 | 1 | Andreas Kohlbecker | (area data) ad=<layer name>:<area set>[;..] |
390 | <area set> ::= <area style ids>:<area id list> |
||
391 | <area id list> ::= <area id>[,..] |
||
392 | ~~~ |
||
393 | |||
394 | Where |
||
395 | |||
396 | |||
397 | 23 | Franck Theeten | * `<area style ids>` is a string of one letter `[a-z,A-Z]` area style ids |
398 | 1 | Andreas Kohlbecker | |
399 | 23 | Franck Theeten | * `<area id>` either is the shape index as defined in the *.shx file or a area name. Area names are internally translated by the service ito shape index. |
400 | 1 | Andreas Kohlbecker | |
401 | 23 | Franck Theeten | * `<field name>` (2nd parameter of previous case) can be dropped in this case. |
402 | 1 | Andreas Kohlbecker | |
403 | |||
404 | |||
405 | ## Area Style |
||
406 | |||
407 | |||
408 | *Attribute*: |
||
409 | |||
410 | ~~~ |
||
411 | (area style) as=<area style id>:<area style definition>[;..] |
||
412 | |||
413 | <area style definition> ::= <pattern id>/<color>[/<style_label>] - defines a pattern and foreground color to fill a shape with |
||
414 | <area style definition> ::= <color>[/<style_label>] - defines a background (fill) color for a shape |
||
415 | ~~~ |
||
416 | Where |
||
417 | |||
418 | * `<pattern id>` is a number from 0 to 99 identifying a predefined fill pattern |
||
419 | |||
420 | * `<color>` is a RGB hex code always 6 letters long |
||
421 | |||
422 | * `<style_label>` is the label of the style in the legend |
||
423 | |||
424 | |||
425 | *Further improvement*: |
||
426 | |||
427 | |||
428 | Removing the unnecessary colons used as separator, they are just for readability. |
||
429 | |||
430 | |||
431 | Area styles can easily parsed without. |
||
432 | 39 | Franck Theeten | |
433 | |||
434 | ### Point Style |
||
435 | |||
436 | |||
437 | *attribute*: |
||
438 | |||
439 | |||
440 | ~~~ |
||
441 | os=indexer:shape/RGB_fillcolor/size_of_shape/label |
||
442 | (1 indexer; 4 parameters separated by “/”): |
||
443 | ~~~ |
||
444 | |||
445 | e.g: |
||
446 | |||
447 | os=1:c/0000FF/17/others |
||
448 | |||
449 | |||
450 | indexer = 1 (can also be text) |
||
451 | |||
452 | |||
453 | shape = “c” (circle). other possible values: "c"=>circle; "s" =>star; "sq"=> square |
||
454 | |||
455 | |||
456 | fill color = 0000FF (Blue) |
||
457 | |||
458 | |||
459 | size = 17 |
||
460 | |||
461 | |||
462 | label = "others" |
||
463 | |||
464 | |||
465 | |||
466 | |||
467 | 1 | Andreas Kohlbecker | |
468 | |||
469 | |||
470 | ## Grids |
||
471 | |||
472 | |||
473 | |||
474 | *Attributes*: |
||
475 | |||
476 | |||
477 | ~~~ |
||
478 | (grid resolution) gr=<layer name>[:<layer style id>]:<long>[,<lat>] - specifies a grid layer |
||
479 | |||
480 | (grid data) gd=<layer name>:<cell set>[;..] |
||
481 | <cell set> ::= <cell style id>:<cell id> |
||
482 | ~~~ |
||
483 | |||
484 | |||
485 | |||
486 | Where |
||
487 | |||
488 | `<layer name>` is the name of a predefined grid layer or a new name identifying the grid specified by the additional attributes. |
||
489 | |||
490 | `<long>` is horizontal resolution in degrees eg. 1, 10, 0.6, 0.1 ... |
||
491 | |||
492 | |||
493 | `<lat>` This optional attribute is the vertical resolution in degrees eg. 1, 10, 0.6, 0.1. if felt out the `<long>` attribute will taken instead |
||
494 | |||
495 | |||
496 | <cell id> is the identifier of a cell concatenated of the horizontal and vertical cell number (figure) or the cell identifier of a predefined grid layer like UTM 25000. |
||
497 | |||
498 | |||
499 | ~~~ |
||
500 | 0 1 |
||
501 | +---+---+ |
||
502 | 0 | 00| 01| |
||
503 | +---+---+ |
||
504 | 1 | 10| 11| |
||
505 | +---+---+ |
||
506 | ~~~ |
||
507 | |||
508 | > If grid follows an already defined projection and resolution (for example UTM 25000 resolution that can be seen in mapViewer) we already have in our database the corresponding code for each cell. This code can be labeled (shown on the map). |
||
509 | |||
510 | > |
||
511 | |||
512 | >> So we can ad the following to the proposal (see above..) |
||
513 | |||
514 | |||
515 | ~~~ |
||
516 | <cell style id> is the id of a cell style .... [TODO] |
||
517 | ~~~ |
||
518 | |||
519 | **Open questions:** |
||
520 | |||
521 | |||
522 | * how to define style labels for the longitude and latitude axis? |
||
523 | |||
524 | |||
525 | |||
526 | ## Occurrences |
||
527 | |||
528 | |||
529 | *Attributes*: |
||
530 | |||
531 | |||
532 | ~~~ |
||
533 | (occurrence data) od=<occurrence set id>:<occurrence entry list> |
||
534 | <occurrence entry list> ::= <occurrence entry>[;..] |
||
535 | <occurrence entry> ::= <long>,<lat>[,<precision>] |
||
536 | |||
537 | (occurrence style) os=<occurence style definition>[;..] |
||
538 | <occurence style definition> ::= <occurrence set id>:<style>/<color> |
||
539 | ~~~ |
||
540 | |||
541 | Where |
||
542 | |||
543 | |||
544 | * `<occurrence set id>` is an number [0-9] on 1..n digits |
||
545 | |||
546 | * `<long>` is longitude in degrees of the occurrence point |
||
547 | |||
548 | * `<lat>` is latitude in degrees of the occurrence point |
||
549 | |||
550 | * `<precision>` precision |
||
551 | |||
552 | * `<color>` is a RGB hex code always 6 letters long |
||
553 | |||
554 | * `<style>` either one letter [[a-z|A-Z]] except 'u' and 'z' which are used for |
||
555 | |||
556 | * u: u<unicode hex code(4 letters)> unicode character as occurrence point icon |
||
557 | |||
558 | * z: z<number> custom style reserved for future use |
||
559 | |||
560 | * c: circle |
||
561 | |||
562 | * s: square |
||
563 | |||
564 | * .... |
||
565 | |||
566 | |||
567 | 9 | Andreas Kohlbecker | |
568 | ## Legends |
||
569 | |||
570 | |||
571 | Legends can be either be horizontal or vertical legends (see below) you can place the legend on top or bottom or at the left or right side or at the edges of the map. |
||
572 | |||
573 | |||
574 | ~~~ |
||
575 | (map legend type) mlt=<legend type id> |
||
576 | <legend type id> ::= h|v // see below for explanation |
||
577 | |||
578 | (map legend position) mlp= |
||
579 | <legend position id> ::= 1|2|3|4|5|6|7|8 // see below for explanation |
||
580 | ~~~ |
||
581 | |||
582 | |||
583 | **horizontal legend** (@mlt=h@): |
||
584 | |||
585 | ~~~ |
||
586 | item 1 |
||
587 | item 2 |
||
588 | item 3 |
||
589 | ~~~ |
||
590 | |||
591 | **vertical legend** (@mlt=v@): |
||
592 | |||
593 | ~~~ |
||
594 | item 1 item2 item 3 |
||
595 | item 4 item 5 item 6 |
||
596 | ~~~ |
||
597 | |||
598 | *legend positioning*: |
||
599 | |||
600 | ~~~ |
||
601 | +-----+ |
||
602 | |1 2 3| |
||
603 | |4 5| |
||
604 | |6 7 8| |
||
605 | +-----+ |
||
606 | ~~~ |
||
607 | 1 | Andreas Kohlbecker | |
608 | |||
609 | ## Map Image |
||
610 | |||
611 | |||
612 | Attributes: |
||
613 | |||
614 | ~~~ |
||
615 | (map size) ms=[<units>:][<width>][,<height>] |
||
616 | |||
617 | (map resolution) mr=<pdi> |
||
618 | ~~~ |
||
619 | |||
620 | |||
621 | Where |
||
622 | |||
623 | * `<units>` is optional an is one of px, mm, cm, .... defaults is px |
||
624 | |||
625 | * `<pdi>` is the resolution of the image in dpi, default is 72dpi |
||
626 | |||
627 | |||
628 | *Open questions*: |
||
629 | |||
630 | |||
631 | * color space / profile definition could be important for print quality maps required? how to ? |
||
632 | |||
633 | * how to style and configure legends? |
||
634 | 16 | Pere Roca Ristol | |
635 | |||
636 | |||
637 | ## Labels |
||
638 | |||
639 | |||
640 | How to define for each layer if we are interested (or not) to view it's label? |
||
641 | |||
642 | Andreas K. suggested these two main options: |
||
643 | |||
644 | |||
645 | 1) extend the labels parameter: |
||
646 | |||
647 | |||
648 | labels =<layer name>:[0|1],... |
||
649 | |||
650 | |||
651 | 2) extend the layers parameter with something like: |
||
652 | |||
653 | |||
654 | (layer) l=<layer name>[[[<layer|style id>]],[[<labels_on>]|[/<shp file url>]][[<raster|data url>]]];... |
||
655 | 28 | Franck Theeten | |
656 | |||
657 | |||
658 | |||
659 | ## Background WMS layer |
||
660 | |||
661 | |||
662 | The REST services also provide possibility to display background layer coming from external WMS: |
||
663 | |||
664 | |||
665 | There are 3 parameters to take into consideration |
||
666 | |||
667 | |||
668 | |||
669 | |||
670 | 1) "externalwms" : The base URL of the WMS to query ("root" of the GetCapabilities" request. |
||
671 | |||
672 | |||
673 | |||
674 | 2) [externalwmsversion]() The version of the WMS standard used by the server (OPTIONAL: default value is "1.1.1") |
||
675 | |||
676 | |||
677 | |||
678 | 3) "externalwmslayer" : A list of layers coming from the same WMS (comma-separated) |
||
679 | |||
680 | |||
681 | The complete syntax is the following: |
||
682 | |||
683 | |||
684 | ~~~ |
||
685 | externalwms=[base URI of the WMS]&externalwmsversion=[externalwmsversion]&externalwmslayer=[name_layer_1][,name_layer_2][,...name_layer_n] |
||
686 | ~~~ |
||
687 | |||
688 | |||
689 | |||
690 | e.g.: |
||
691 | |||
692 | |||
693 | |||
694 | ~~~ |
||
695 | http://edit.br.fgov.be/edit_wp5/v1/rest_gen.php?od=1:52.17,14.26|52.18,14.26|52.16,14.27|52.16,14.28|52.16,14.29|52.29,14.26|52.28,14.39|52.28,14.41|52.2,14.43|52.19,14.52|52.12,14.46|52.13,14.46|52.11,14.47|52.12,14.47|52.13,14.47|52.18,14.49|52.19,14.49|52.06,14.5|52.07,14.5|52.09,14.5|52.06,14.51|52.07,14.51|52.21,14.51|52.06,14.52||2:52.08,14.53|52.09,14.53|52.06,14.55&os=1:s/8B0000/7/all||2:c/0000FF/7/others&l=earth:d&ad=vmap0_eur_pop_built_up_a:nam:d:%||vmap0_eur_pop_built_up_a:nam:a:EICHWALDE||vmap0_eur_pop_built_up_a:nam:b:COTTBUS||vmap0_eur_pop_built_up_a:nam:c:ZERNSDORF,BINDOWBRUCK,SENZIG&as=a:984ea3|b:ff7f00,1,0.1|c:ffff33,,0.1|d:FFCEFD,FFCEFD,0.1&title=a:EICHALDE|b:COTTBUS|c:ZERNSDORF,BINDOWBRUCK,SENZIG|d:others%20municipalities&img=true&recalculate=true&legend=1&mlp=1&ms=400,350&bbox=13.50,51.4,15,52.7&recalculate=false&callback=true&externalwms=http://isk.geobasis-bb.de/ows/dnm.php&externalwmsversion=1.1.1&externalwmslayer=bg%2Cvegetation%2Cgewaesser%2Csiedlung%2Cbln%2Cbrb%2Ctransport%2Cverkehrsobjekte%2Cstrassennamen%2Cortsnamen%2Cgewaessernamen |
||
696 | ~~~ |
||
697 | 40 | Franck Theeten | |
698 | |||
699 | 43 | Franck Theeten | |
700 | 44 | Franck Theeten | ## Available layers |
701 | |||
702 | |||
703 | |||
704 | 49 | Franck Theeten | ### 1) topp:em_tiny_jan2003 _Added 2013/07/25_ |
705 | 48 | Franck Theeten | |
706 | (layer originating from the Helsinki Natural history museum for Euro+Med areas : http://dev.e-taxonomy.eu/trac/ticket/2707). |
||
707 | 1 | Andreas Kohlbecker | |
708 | |||
709 | 43 | Franck Theeten | |
710 | 48 | Franck Theeten | |
711 | |||
712 | 1 | Andreas Kohlbecker | ## Available Projections |
713 | |||
714 | 48 | Franck Theeten | |
715 | |||
716 | 50 | Franck Theeten | ### 1) EPSG:7777777 _Added 2013/07/25_ |
717 | 48 | Franck Theeten | |
718 | 1 | Andreas Kohlbecker | Projection for topp:em_tiny_jan2003 |
719 | 48 | Franck Theeten | |
720 | WKT (geoserver "epsg.properties): |
||
721 | |||
722 | 51 | Andreas Kohlbecker | ~~~ |
723 | 52 | Andreas Kohlbecker | 7777777=PROJCS[ |
724 | "Lambert_Conformal_Conic", |
||
725 | GEOGCS[ |
||
726 | "GCS_Unknown", |
||
727 | DATUM[ |
||
728 | "D_European_1950", |
||
729 | SPHEROID[ |
||
730 | "International_1924", |
||
731 | 6378388,297 |
||
732 | ] |
||
733 | ], |
||
734 | PRIMEM[ |
||
735 | "Greenwich", |
||
736 | 0 |
||
737 | ], |
||
738 | UNIT[ |
||
739 | "Degree", |
||
740 | 0.017453292519943295 |
||
741 | ] |
||
742 | ], |
||
743 | PROJECTION[ |
||
744 | "Lambert_Conformal_Conic" |
||
745 | ], |
||
746 | PARAMETER[ |
||
747 | "standard_parallel_1", |
||
748 | 42 |
||
749 | ], |
||
750 | PARAMETER[ |
||
751 | "standard_parallel_2", |
||
752 | 56 |
||
753 | ], |
||
754 | PARAMETER[ |
||
755 | "latitude_of_origin", |
||
756 | 35 |
||
757 | ], |
||
758 | PARAMETER[ |
||
759 | "central_meridian", |
||
760 | 24 |
||
761 | ], |
||
762 | PARAMETER[ |
||
763 | "false_easting", |
||
764 | 3000000 |
||
765 | ], |
||
766 | PARAMETER[ |
||
767 | "false_northing", |
||
768 | 100000 |
||
769 | ], |
||
770 | UNIT[ |
||
771 | "Meter", |
||
772 | 1 |
||
773 | ] |
||
774 | ] |
||
775 | 1 | Andreas Kohlbecker | ~~~ |
776 | Proj4 (PostGIS): |
||
777 | |||
778 | 51 | Andreas Kohlbecker | ~~~ |
779 | 52 | Andreas Kohlbecker | +proj= lcc + 42 + 56 + 35 + 24 + 3000000 + 100000 (id in the spatial_ref_sys_table is 7777777) |
780 | 51 | Andreas Kohlbecker | ~~~ |