문제

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

도움이 되었습니까?

해결책

Replace

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

with

open my $file, '<', $filename;
local $/;
$osmdata = <$file>;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top