I must draw a boundary of a natural reserve area in mapnik so that it looks like this:
It is a partially opaque green polygon with a wide line border (also partially opaque) on the inside of the said polygon.
Now, the problem is - how do I tell mapnik (in style XML) to draw the line only on the inside(!) of the polygon.
Mapnik wants to draw the line axially centered at the polygon boundary, so that half of it always "hangs" outside of the polygon like this, and it is no Ok:
The code for the result you see is this:
<Style name="nature_reserve"> <Rule> <PolygonSymbolizer fill="#4eaa2f" fill-opacity=".3" gamma=".2" /> <LineSymbolizer stroke="#4eaa2f" stroke-opacity=".5" stroke-width="20" /> </Rule> </Style> <Layer name="nature_reserve" status="on" srs="+proj=longlat +datum=WGS84 +no_defs"> <StyleName>nature_reserve</StyleName> <Datasource> <Parameter name="type">shape</Parameter> <Parameter name="file">data/osm/nature_reserve</Parameter> </Datasource> </Layer>
I am a newbie to Mapnik, so that is about all I can think of. Any better suggestions?
Never mind the jagged lines, that is irrelevant now. All I care about is getting the outline inside the polygon.
Can it be offset somehow?
I did not find any options for this in documentation.
They are doing it in OpenStreetMap, so there must be the way: