[Tilesathome] newbie question: xmlstarlet error: Tile too complex
milenko at king-nerd.com
milenko at king-nerd.com
Sun Nov 4 13:00:16 GMT 2007
I asked the same question a little bit ago.
Here is the reply from Jochen, which also explains why this happens and how to
fix it.
-------Jochen Reply--------
Hi,
> This may not necessarily be a t at h problem, but the bulk import in the
> 943,1499 area is importing what looks like thousands of nodes per tile.
> Even straight ways have hundreds of nodes.
That indeed is a problem of the data (and a little of t at h, as I'll explain
further down).
To understand why these ways have so many nodes, you have to know that
South Dakota has some streets running through the full extent of the
state. Some of the streets even continue into North Dakota. That results
in ways longer than 250 miles! All one street with the same name!
These ways have to be cut into smaller pieces by a script or by hand.
> The above tile in particular crashes xmlstarlet - I assume because of the
> excessive number of nodes in the tile.
There is a fix for xmlstarlet though. The abort happens when the limit
of nested template calls (xsltMaxDepth) is reached. An out-of-the-box
xmlstarlet installation uses a default value of 3000 for this parameter.
It is needed to catch endless recursions.
But by pushing this limit a bit, the problem at hand can be defeated.
Changing line 955 of tilesGen.pl (SVN Rev. 5202)
- my $Cmd = sprintf("%s \"%s\" tr %s %s > \"%s\"",
+ my $Cmd = sprintf("%s \"%s\" tr --maxdepth 20000 %s %s > \"%s\"",
has done the trick.
This has successfully been tested with tile 638,1536 and the one you
stated, 943,1499. Both of which used to cause the maxdepth overflow
before.
I don't know if 20000 will always be enough. Maybe some tiles need even
more, or maybe 20000 already uses too much RAM / stack size on some
systems, so that xmlstarlet will crash muss less gracefully than it does
with a value of 3000.
Cheers,
Jochen
-----------------------
I tried his suggestion and it seems to have helped my clients.
-Jeremy
Original Message -----------------------
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
after i recieved my upload credentials yesterday, i started generating tiles,
but soon the following error occured:
- ------------------------8<---------------------------------------------------
> [#17 0% jobinit] Doing tileset 1220,1516 (area around 42.261041,-72.729492)
> [#17 0% default] Transforming zoom level 16... ERROR
> The following command produced an error message:
> nice -n10 "xmlstarlet" tr osmarender/osmarender.xsl map-features-29312.xml
> "/tmp/output-29312-z16.svg-temp.svg"
> Debug output follows:
> | I/O error : Attempt to load network entity http://xobjex.com/service/date.xsl
> | warning: failed to load external entity "http://xobjex.com/service/date.xsl"
> |
> | Processing
> | Matched by 24520 elements for layer 0.
> |
> |
> | Processing
> | Matched by 690 elements for layer 0.
> |
> |
> | Processing
> | Matched by 3 elements for layer 0.
> |
> |
> | Processing
> | Matched by 594 elements for layer 0.
> |
> |
> | Processing
> | Matched by 23 elements for layer 0.
> |
> |
> | Processing
> | Matched by 70 elements for layer 0.
> |
> |
> | Processing
> | Matched by 690 elements for layer 0.
> |
> |
> | Processing
> | Matched by 3 elements for layer 0.
> |
> |
> | Processing
> | Matched by 594 elements for layer 0.
> |
> |
> | Processing
> | Matched by 23 elements for layer 0.
> |
> |
> | Processing
> | Matched by 70 elements for layer 0.
> |
> |
> | Processing
> | Matched by 690 elements for layer 0.
> |
> |
> | Processing
> | Matched by 690 elements for layer 0.
> |
> |
> | Processing
> | Matched by 7 elements for layer 0.
> |
> |
> | Processing
> | Matched by 24520 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 3 elements for layer 5.
> |
> | runtime error: file osmarender/osmarender.xsl line 692 element param
> | xsltApplyXSLTTemplate: A potential infinite template recursion was
detected.
> | You can adjust xsltMaxDepth (--maxdepth) in order to raise the maximum
number of nested template calls and variables/params (currently set to 3000).
> | Templates:
> | #0 name getPathLength
> | #1 name getPathLength
> | #2 name getPathLength
> | #3 name getPathLength
> | #4 name getPathLength
> | #5 name getPathLength
> | #6 name getPathLength
> | #7 name getPathLength
> | #8 name getPathLength
> | #9 name getPathLength
> | #10 name getPathLength
> | #11 name getPathLength
> | #12 name getPathLength
> | #13 name getPathLength
> | #14 name getPathLength
> | Variables:
> | #0
> | var absLengthLat
> | #1
> | var lengthLat
> | #2
> | var absLengthLon
> | #3
> | var lengthLon
> | #4
> | var toNode
> | #5
> | var fromNode
> | #6
> | pathLengthMultiplier
> | nodes
> | sumLat
> | sumLon
> | #7
> | nodes
> | sumLat
> | sumLon
> | #8
> | sumLat
> | sumLon
> | #9
> | sumLon
> | #10
> | var absLengthLat
> | #11
> | var lengthLat
> | #12
> | var absLengthLon
> | #13
> | var lengthLon
> | #14
> | var toNode
> |
> | Processing
> | Matched by 594 elements for layer 5.
> |
> |
> | Processing
> | Matched by 23 elements for layer 5.
> |
> |
> | Processing
> | Matched by 70 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 690 elements for layer 5.
> |
> |
> | Processing
> | Matched by 3 elements for layer 5.
> |
> |
> | Processing
> | Matched by 594 elements for layer 5.
> |
> |
> | Processing
> | Matched by 23 elements for layer 5.
> |
> |
> | Processing
> | Matched by 70 elements for layer 5.
> |
> |
> | Processing
> | Matched by 23830 elements for layer 5.
> |
> | no result for map-features-29312.xml
>
> Additional info about the Error(s):
>
> * Tile too complex for Xmlstarlet, possibly an excessively long way, or too
many maplint errors
>
> [#17 0% default] File /tmp/output-29312-z16.svg-temp.svg doesn't look like
svg, aborting render.
- ------------------------8<---------------------------------------------------
Is this due to lack of RAM (my machine has 1.5 GB), to the osm data or to a
configuration problem?
florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHLZVbEZ7gvZzaN1cRAqNIAJ0bXhHj00fdxT0mRxPvZJS6duYJBwCbBqNY
HJY6ZjU6ERU1q0Hkx5HXbhk=
=TR0a
-----END PGP SIGNATURE-----
_______________________________________________
Tilesathome mailing list
Tilesathome at openstreetmap.org
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/tilesathome
More information about the Tilesathome
mailing list