Project

General

Profile

MapRestServiceIdeas » History » Version 8

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