[Tilesathome] close-areas producing very long ways -> inkscape crashing
Frederik Ramm
frederik at remote.org
Sat Oct 20 11:00:13 BST 2007
Hi,
> What is actually the reason that not all areas work like coastlines?
There are two important requirements for coastline rendering to work:
1. If the area you are rendering contains coastline, you need to know on
which side is land and on which is water;
2. If the area you are rendering contains no coastline, you need to know
wheter it is a water area or a land area.
We have solved (1) by saying what water is always on the right and you
have to draw your coastline accordingly.
We have solved (2) by using a "tile index" that, for every level-12 tile
in existence, tells us wheter that is a land or a sea tile; that index
was relatively easy to create from existing free data. It is a kludge
because it only works if you look at the world in level-12 units (about
10x10km) - if I throw a random 5x5km area at you for rendering, then you
may not be able to determine wheter it should be blue or not with this
method.
If we want to use this method for all other types of areas - lakes,
woods, landuse areas, natural reserves - then we would have to find a
working equivalent to the "tile index" we now have. Let's take the
example of natural reserves as they are often quite big. Whenever you
render a tile that does not contain a natural reserve boundary, you
would have to somehow find out if the whole tile is inside a natural
reserve. For this, is might not be so easy to create an index - and much
less so for other areas.
One possible, hacky but promising IMHO, solution is the use of "control
nodes". This would require you to place (at least) one node somewhere
into any level-12 tile that is in a natural reserve, tagged (for
example) "close-areas:landuse=wood". The close-areas script would then
be extended to have a list of known large area tags, like landuse=wood,
and handle them like it does coastline now; when it handles a tile that
does not contain any landuse=wood ways, it would look for a control node
and if one is found, assume that the whole tile is inside a landuse=wood
area.
This would clutter our database with "control nodes", but since they are
only required where there are areas significantly larger than 100 sq km,
there shouldn't be too many. (These nodes would only be used where the
areas in question must be rendered on the slippy map. Anyone is free to
create an area for, say, the whole of France, but they would not then
expect any zoomed tile view inside France to have the background colour
of France or so.)
The disadvantage about this is of course that it is a solution geared
specifically towards tiles at home rendering. In an ideal world, the
database server would give you a list of areas that fully contain the
bounding box you are downloading, but we cannot do that at the moment
because the database would grind to halt. Anyone willing to design and
implement API extensions to make this feasible is welcome ;-)
Bye
Frederik
More information about the Tilesathome
mailing list