[OSM-talk] Tiles at home Update

80n 80n80n at gmail.com
Tue Mar 20 11:56:20 GMT 2007


On 3/20/07, Frederik Ramm <frederik at remote.org> wrote:
> Hi,
>
> > It also utilises a pre-processor (called Frollo) which sorts out the
> > ordering and direction of segments.
>
> Hm. Doing everything in XSLT certainly is an interesting programming
> challenge ;-)

It wouldn't be fun to do it the easy way ;)

>
> I'm curious on how you solved the segment reversal problem. I did an
> automatic way ordering and segment reversal tool in Perl but got into
> trouble when a segment was shared by more than one way:
>
> 1. Since I processed the ways one after the other, when I re-visited
> the same segment in the context of a different way, reversing the
> segment (which might have been required for the current way to "work"
> properly) would have meant going back to the other way that used it
> and try if that still works with the segment reveresed. Which seemed
> complicated, especially because the concept is recursive.

Recursion is XSL's middle name.

>
> 2. If there are ways using the same segment, and each one would
> require the segment to be in a different direction, which should
> "win" - or should the segment be duplicated?
>
> 3. Same if one way using a segment has a context where segment
> reversal is not allowed (say, a river or a way with oneway=true).
> Another way uses the same segment (e.g. a tram running through the
> one-way street) but would require reversal...
>

There's a simple solution.  Frollo tags the <seg> elements that should
be reversed.  Then Osmarender just has to look at this tag and swap
@from and @to when appropriate.

<way id='1'>
  <seg id='12345' osma:reverse='1'>
</way>


80n




More information about the talk mailing list