[OSM-dev] Map rendering code... API or database direct?
immanuel.scholz at gmx.de
immanuel.scholz at gmx.de
Thu Mar 30 11:22:59 BST 2006
Hi,
> there is another better way yet, available at the sql level...
> select all line segments that have a "foot" in the tile you're
> interested in.
> something like
>
> if (node_a in [tile]) or (node_b in [tile]) then
> draw_segment
> end
This will not draw line segments which only passes your tile (and these line
segments we are speaking of)
| |
| * |
| / |
---------+----/---------------+-------------
| / |
| / |
| / |
|/ |
/ |
/| |
* | |
| |
---------+--------------------+-------------
| |
| |
| |
Neither of the nodes are in the middle tile, but still the line segment has to
be drawn.
There is a very fast algorithm to decide whether a line cannot pass a bounding
box (it is not said that there could be more lines that do not pass, but at
least you sort some of them out). I can lookup and explain the algorithm, if
someone is interested.
Ciao, Imi.
More information about the dev
mailing list