Skip to content

Commit 201a186

Browse files
committed
update docs
1 parent aa8ccca commit 201a186

File tree

8 files changed

+131
-19
lines changed

8 files changed

+131
-19
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ This repository contains a fork of [github.com/mapnik/mapnik](https://github.com
44

55
* [Tree-like layer structure](docs/features/layer-structure.md)
66
* [Layer level compositing](docs/features/layer-level-compositing.md)
7+
* [Unification of placement code](docs/features/placement-code-unified.md)
8+
* [Placement `grid` and `alternating-grid`](docs/features/placement-grid.md)
9+
* [CollisionSymbolizer](docs/features/collision-symbolizer.md)
10+
* [Keyed collision caches](docs/features/keyed-collision-caches.md)
711
* [Text placement method `combined`](docs/features/text-placement-combined.md)
812
* [Text placement method `angle`](docs/features/text-placement-angle.md)
913
* [Anchors](docs/features/anchors.md)
10-
* [Text placement `grid`](docs/features/text-placement-grid.md)
14+
* [Pattern symbolizers improvements](docs/features/pattern-symbolizers.md)
1115
* [Text on extended geometry](docs/features/text-extend.md)
1216
* [Shadows with building symbolizer](docs/features/building-symbolizer-shadow.md)
1317
* [XSLT preprocessing](docs/features/xslt-preprocessing.md)
14-
* Offsetting algorithm
15-
* Constant height of a first text line
1618

1719
# Mapnik
1820

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# `CollisionSymbolizer`
2+
3+
It's sometimes convinient to "render" some invisible labels and insert them into collision detector in order to protect their places agains other objects. This can be done by `TextSymbolizer` or `MarkersSymbolizer` with `opacity="0"` but it comes with unnecessary performance overhead of text or marker rendering and seems like hackish solution in general. The `CollisionSymbolizer` solves that.
4+
5+
## An example
6+
7+
[collision-symbolizer-4.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/collision-symbolizer-4.xml)
8+
9+
![collision-symbolizer-4](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/collision-symbolizer-4-800-800-1.0-agg-reference.png)
10+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Keyed collision caches
2+
3+
All symbolizers working with collision detector have parameters `collision-cache-detect` and `collision-cache-insert`. These parameters set names of collision detectors. Multiple names delimited by comma are supported. If one of these parameters is not defined, collision detector with name `default` is used instead. The `default` collision detector can be referenced explicitly.
4+
5+
An example of inserting objects only into collision detector called `water`:
6+
7+
```
8+
collision-cache-insert="water"
9+
```
10+
11+
An example of detection against collision detector called `water` and default collision detector:
12+
13+
```
14+
collision-cache-detect="water,default"
15+
```
16+
17+
## `DebugSymbolizer`
18+
19+
`DebugSymbolizer` has parameter `collision-cache` for comma separated list of collision detectors to visualize. If `collision-cache` is not set, all objects of all collision detectors are visualized.
20+
21+
## An example
22+
23+
[collision-cache-1.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/collision-cache-1.xml)
24+
25+
![collision-cache-1](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/collision-cache-1-800-800-1.0-agg-reference.png)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Pattern symbolizers improvements
2+
3+
## Better SVG support
4+
5+
Both `LinePatternSymbolizer` and `PolygonPatternSymbolizer` can customize SVG pattern by parameters
6+
7+
* `fill`
8+
* `fill-opacity`
9+
* `stroke`
10+
* `stroke-width`
11+
* `stroke-opacity`
12+
13+
### An example
14+
15+
[polygon-pattern-2.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/polygon-pattern-2.xml)
16+
17+
![polygon-pattern-2](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/polygon-pattern-2-256-256-1.0-agg-reference.png)
18+
19+
## Parameter `spacing`
20+
21+
Parameter `spacing` of `PolygonPatternSymbolizer` sets spacing between individual images of given pattern.
22+
23+
### An example
24+
25+
[polygon-pattern-6.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/polygon-pattern-6.xml)
26+
27+
![polygon-pattern-6](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/polygon-pattern-6-256-256-1.0-agg-reference.png)
28+
29+
## Parameter `lacing`
30+
31+
Parameter `lacing` of `PolygonPatternSymbolizer` set to `alternating-grid` will render pattern resembling bricks in a wall. Value `grid` is the default when parameter is unset.
32+
33+
### An example
34+
35+
[polygon-pattern-3.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/polygon-pattern-3.xml)
36+
37+
![polygon-pattern-3](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/polygon-pattern-3-256-256-1.0-agg-reference.png)
38+
39+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Unification of placement code
2+
3+
All these symbolizers have common purpose - placing labels on some geometric positions:
4+
5+
* `TextSymbolizer`
6+
* `ShieldSymbolizer`
7+
* `GroupSymbolizer`
8+
* `MarkersSymbolizer`
9+
* `PointSymbolizer`
10+
* `CollisionSymbolizer`
11+
12+
It makes sense to allow all possible placement options for all these symbolizers. Therefore all these symbolizers support all these placement options:
13+
14+
* `point`
15+
* `interior`
16+
* `centroid`
17+
* `line`
18+
* `vertex`
19+
* `vertex-first`
20+
* `vertex-last`
21+
* `grid`
22+
* `alternating-grid`
23+
24+
This unification is a result of great code sharing and simple [declarative description](https://github.com/mapycz/mapnik/blob/63ed040a3c1817db8b5a3f1333dccc9fb5d42f8b/include/mapnik/text/symbolizer_helpers.hpp#L57-L106) of each symbolizer.

docs/features/placement-grid.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# Placement `grid` and `alternating-grid`
3+
4+
Allows placing repeated labels on area of a polygon. All possible placements create grid of points. Only placements within given polygon are rendered.
5+
6+
`alternating-grid` creates pattern similar to bricks in a wall.
7+
8+
Very important is order in which grid is iterated and individual placements placed. The first point is polygon's interior. Subsequent placements go around interior in a spiral.
9+
Only `CollisionSymbolizer` does not work this way, but rather iterates the grid in left-right top-down order.
10+
11+
These are basic use cases:
12+
13+
* Labeling areas in given density.
14+
* Trying various positions around interior.
15+
* Adding areas into collision detector by `CollisionSymbolizer`.
16+
17+
Grid density can be controlled by `grid-cell-width` and `grid-cell-height` properties of the symbolizer.
18+
19+
## An example
20+
21+
[grid-on-polygon-3.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/grid-on-polygon-3.xml)
22+
23+
![grid-on-polygon-3](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/grid-on-polygon-3-800-800-1.0-agg-reference.png)
24+
25+
[grid-on-polygon-1-marker-alternating.xml](https://github.com/mapycz/test-data-visual/blob/master/styles/grid-on-polygon-1-marker-alternating.xml)
26+
27+
![grid-on-polygon-1-marker-alternating](https://raw.githubusercontent.com/mapycz/test-data-visual/master/images/grid-on-polygon-1-marker-alternating-800-800-1.0-agg-reference.png)

docs/features/text-extend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Text on extended geometry
33

4-
Allows to render text along line when length of the text exceeds length of the line. Beginning and ending segments of the underlaying line are extended by number of pixes given by parameter `extend`.
4+
Allows to render text along line when length of the text exceeds length of the line. Beginning and ending segments of the underlaying line are extended by number of points given by parameter `extend`.
55

66
## An example
77

docs/features/text-placement-grid.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)