Extra content at the end of the document: </node>

Hi,

I’m running osm2pgsql on a centos 4.7 machine using the peak-north extract from http://nick.dev.openstreetmap.org/downloads/planet.

When ever i run: ./osm2pgsql -m -d gis …/peak-north-090729.osm

i get the following output:

osm2pgsql SVN version 0.66-

Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100

Reading in file: …/peak-north-090729.osm
Processing: Node(100k) Way(0k) Relation(0k)Entity: line 214263: parser error : Extra content at the end of the document

^
…/peak-north-090729.osm : failed to parse
Error occurred, cleaning up

could anyone help? Thanks.

It would seem the xml was ill-formed. I added at the end of the file by echo “” >> peak-north-090729.osm and it returned :

cd /tmp/osm2pgsql/; ./osm2pgsql -m -d gis …/peak-north-090729.osm
osm2pgsql SVN version 0.66-

Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100

Reading in file: …/peak-north-090729.osm
Processing: Node(107k) Way(0k) Relation(0k)
Node stats: total(107991), max(447991674)
Way stats: total(0), max(0)
Relation stats: total(0), max(0)

Writing way(0k)

Writing rel(0k)
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads
Committing transaction for planet_osm_point
Sorting data and creating indexes for planet_osm_line
Sorting data and creating indexes for planet_osm_roads
Sorting data and creating indexes for planet_osm_polygon
Sorting data and creating indexes for planet_osm_point
Completed planet_osm_roads
Completed planet_osm_line
Completed planet_osm_polygon
Completed planet_osm_point

I assume this is correct?! Could someone shed any light as to why the xml was wrong?

I assume the extract was corrupt, or your download was incomplete. Hard to check, because the url you gave 404’s on me.

Okay, the extra . caused the 404.

Having checked peak-north-090729.osm, I can definately say that the file is incomplete. Even with your you still don’t have a meaningful import, since there are only nodes in the file, no ways and relations.

All the 090729 extracts there are shorter than previously, so I assume all of them are broken.

edit: I emailed the maintainer. Hope he can get around to it, so you have fresh extracts to work with. In the mean time, you’d better use one of the older ones.

Ahh. Thank you! I wondered why it was playing up.

Hi, sorry for the late reply, have sorted this out now. The problem was that the maximum node ID in the planet-excerpt script had been exceeded, this happens from time to time. Anyway I’ve raised it now and set the latest extract to rerun tonight. So there should be extracts from 090812 tomorrow. btw are there any alternatives to planetosm-excerpt.pl floating around which don’t have the maximum node ID limit problem?

Nick

I don’t know. I’ve always used osmosis to make my planet extracts.