[OSM-talk] [osm at sspaeth.de: Re: T at H error]

Mark Huizer xaa+openstreetmap at dohd.org
Tue Sep 25 10:26:20 BST 2007


> Xaa has implemented that solution in a patch that makes osmarender.xsl smaller by 2kb as a side effect. It will hopefully prevent the infinite recursion errors.
> 

I'm still not too happy with that patch, since it doesn't work exactly well enough.
If you take the Haringvliet (a water thingie in Netherlands), it still seems to recurse to deep, though that might be in another line, still have to check the details. But this is a 2200 segment natural=water. I checked the folliwhatever-closed-area-osm file, and it is detected as area, so I don't think it should call getPathLength, right?

I remember something in line 1168 to also give recursion error, but haven't checked it out yet, still trying to find my way in osmarender.xsl.

But the patch I sent to spaetz will still barf if you have a segment with a lot of very small segments (like coastlines, or whatever) since the recursion required to find enough room for the name is too deep.

I think recursion should be replaced with something like

<xsl:variable name='totalLength' select='number("0")'/>
<xsl:for-each select='$segments'>
  <xsl:variable name='segid' select='$segments[@id]'/>
  <xsl:variable name='segment' select='/osm/segment[@id=$segid]'/>
  <!-- do calculations for this segment and add to total length -->
</xsl:for-each>

but I'd have to check into correct xsl syntax to do that :-)

Mark




More information about the talk mailing list