Project

General

Profile

MapRestServiceIdeas » History » Version 9

Andreas Kohlbecker, 12/02/2008 05:19 PM

1 7 Andreas Kohlbecker
{{>toc}}
2 1 Andreas Kohlbecker
3 7 Andreas Kohlbecker
4
5
6 1 Andreas Kohlbecker
## Wild and tame ideas for the EDIT Map REST Service API
7
8
9
10
## Area Styles
11 5 Andreas Kohlbecker
12 1 Andreas Kohlbecker
13 9 Andreas Kohlbecker
14
##### Andreas Kohlbecker - 15.10.2008
15
=
16 5 Andreas Kohlbecker
17 8 Andreas Kohlbecker
18
Hhow can border styles for the shapes can be defined?
19
20
21
The current urls demonstrate this feature, the REST api however does not provide any means to specify the line color, width and stroke style. 
22
23
24
This styling is currently defined by a styled layer descriptor, as I assume, but should be exposed by the REST API. 
25
26
27
This style information could be put into the layer attribute or into the area data attribute ‘ad’. 
28
29
30
Currently I would prefer the following solution, which introduces an optional layer style id into the layer attribute. 
31
32
 
33
(layer) l=<layer name>[[<layer|style id>]][[<shp|file url>]][[<raster|data url>]]|...
34
35
36
(layer style) as=<area style id>:<line color>,<line width>,<stroke style>|..
37
38
 
39
The grid layers then could also use the layer style id:
40
41
42
(grid resolution) gr=<layer name>[[<layer|style id>]]:<long>[,<lat>] - specifies a grid layer
43
44
45
46
47 7 Andreas Kohlbecker
##### Andreas Kohlbecker - 27.10.2008, 03.11.2008
48 2 Andreas Kohlbecker
49
50 1 Andreas Kohlbecker
I would prefer a more generic syntax for specifying area styles. First of all I'd like to explain why I think that the Geo REST Service would benefit from a more generic syntax.
51
52
53
Let's assume a situation in which a map should express different kind of information, e.g. distribution, soil characteristics, etc.. In this case one would likely want to express the different kind of information by
54
55
56
 a) the polygon border style  by b) the fill colour of the polygon, c) by a pattern drawn a foreground of the polygon. So we would have to handle arbitrary combinations of the different styles. 
57
58
59
Now if we define the polygon border style, fill colour and the color and pattern drawn in the foreground together in on area style attribute, we would have to define every combination of these individually. This would not only bloat up the style definition but would also bloat up the legend by requiring a <style_label> for each style combination thus introducing redundancy. Therefore I recommend splitting the definitions for 
60
61
62
 
63
64
* polygon border style
65
66
* background fill colour 
67
68
* foreground color and pattern
69
70
71
72
The API proposal already is designed that way: 
73
74
~~~
75
  (area style) as=<area style id>:<color>[,<style_label>]|..              -  defines a background (fill) color for a shape
76
 
77
               as=<area style id>:<pattern id><color>[,<style_label>]|.. -  defines a pattern and foreground color to fill a shape with
78
~~~
79
You can define separate area styles for background and foreground and you can apply arbitrary combinations of these to an area:
80
81
82
~~~
83
(area data) ad=<layer name>:<area style ids>:<area id>,..|<area style ids>:<area id>,..||<layer name>:<area style ids>:<area id>,..|
84
<area style ids> is a string of one letter [a-z,A-Z] area style ids
85
~~~
86
87
The polygon border style however is missing in the API, but we have the 
88
89
~~~
90
(layer style) ls=<layer_style_id>:[<line_color>][,<line_width>][,<stroke_style_id>]|..
91
~~~
92
93
Which is nothing else but a polygon border style applied to all polygons defined in one layer. Maybe we should rename layer style into area border style ?
94
95
96
And split area style into area background style and area foreground style then we would have the following attributes:
97
98
~~~
99
(area background  style) abs=<area style id>:<color>[,<style_label>]|..              -  defines a background (fill) color for a shape
100
 
101
(area foreground style)  afs=<area style id>:<pattern id><color>[,<style_label>]|.. -  defines a pattern and foreground color to fill a shape with
102
 
103
(area polygone style)    aps=<area style id>:[<line_color>][,<line_width>][,<stroke_style_id>][,<style_label>]|.
104
~~~
105
106
The in the currently proposed syntax does not allow using named colors, otherwise the attribute values can not be parsed, so I am using the rgb hex values here
107
108
109
 
110
111
abs=a:aaaaaa|b:ffff00
112
113
aps=c:0000ff,dotted,4|d:0000ff,no-dotted,10| e:00ff00,no-dotted,10
114
115
116
117
area border styles would be also applicable to layers: 
118
119
~~~
120
(layer) l=<layer name>[:[<area style id>][,<shp file url>][,<raster data url>]]|...
121
~~~
122
123
The layer attribute only would accept <area style id>s which actually are area border styles .
124
125
126
127
The the currently proposed syntax does not allow using named colors, otherwise the attribute values can not be parsed, so I am using the rgb hex values here
128
129
~~~
130
abs=a:aaaaaa|b:ffff00
131
aps=c:0000ff,dotted,4|d:0000ff,no-dotted,10| e:00ff00,no-dotted,10
132
~~~
133
Now lets take the styles from your example and express them by combinations of a, b, c, d, e 
134
135
~~~
136
grey,blue,4,dotted = ac
137
grey,blue,10,no-dotted = ad
138
yellow,green,10-no-dotted = be
139
~~~
140
So you would use these combinations of area styles in
141
142
~~~
143
(area data) ad=<layer name>:<area style ids>:<area id>,..|
144
~~~
145
The advantage I see in this approach are the better legends you can create eg:
146
147
148
~~~
149
abs=a:aaaaaa,arid|b:ffff00,semiarid
150
aps=c:0000ff,dotted,4,native|d:0000ff,no-dotted,10,cultivated| e:00ff00,no-dotted,10, abandoned
151
~~~
152
would result in a legend like which explains all possible combinations without the need to explicitly mentioning every one:
153
154
155
~~~
156
[  ] : arid
157
[  ] : semiarid
158
[  ] : native
159
[  ] : cultivated
160
[  ] : abandoned
161
~~~
162 5 Andreas Kohlbecker
163
164 7 Andreas Kohlbecker
##### pere roca ristol - 06.11.2008
165 5 Andreas Kohlbecker
166
167
I think we could also add...
168
169
170
-Area Hatching Style
171
172
173
path_to_symbol=x:path1/y:path2
174
175
ahs=a:x/symbol1|b:x/symbol2|c:y/symbol3
176
177
[[with|an optional parameter to define to the legend]]
178 6 Andreas Kohlbecker
179
180
Resulting in Area Data...
181
182
ad=layer/aac:Mexico,Brazil ... and so on, being aac=color 1,(dotted,5),(y/symbol3)
183
184
185
It's a little crazy and maybe will take some time... but I think it has sense, specially when dealing with many data classification.
186
187 1 Andreas Kohlbecker
188 6 Andreas Kohlbecker
189
## Map Image & Bounding Box
190 8 Andreas Kohlbecker
191
192
193
## Labels on/off
194
195 6 Andreas Kohlbecker
196
197
198
199 7 Andreas Kohlbecker
##### Andreas Kohlbecker - 23.10.2008
200 6 Andreas Kohlbecker
201
202
For example I could say:  BBOX=tdwg1:2  (region 2 of tdwg layer1) this would result in a map showing all of Africa. 
203
204
BBOX=earth would result in a map showing the whole world. 
205
206
207
The recalculate parameter be inferred from what is specified by the ms parameter:
208
209
If only the width is defied ms=700  the service infers that recalculation is desired and will adjust the image height to avoid distortions. 
210
211
If the image height is specified:  ms=,300  the service again  infers that recalculation is desired but  will adjust the width in this case.
212
213
If both width and height are defined the service knows that recalculation is not wanted and creates a distorted map.