Question

I'm using Perl script for extracting POLY from OSM files: https://github.com/sev-/osm/blob/master/getbound.pl

Recently I've got a problem with one big file (around 60M):

curl -XPOST "http://overpass-api.de/api/interpreter" -d"data=[timeout:900];(node(56.59,60.0,56.99,60.96);<);out;" > e.osm
perl getbound.pl -file e.osm 1104258 > e.poly
>unclosed token at line 173936, column 2, byte 9999947 at /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level/XML/Parser.pm line 187.

The XML file is well-formed, the mentioned lines looks fine, and the error message doesn't change at all when I delete the line. Looks like there is overflow in some byte counter inside the library.

Any help would be appreciated! Thank you

Was it helpful?

Solution

Replace

open my $file, '<', $filename;
read $file, $osmdata, 10_000_000;

with

open my $file, '<', $filename;
local $/;
$osmdata = <$file>;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top