Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

I saw something: PBF contains geometry outside bbox #290

Open
missinglink opened this issue Dec 6, 2016 · 2 comments
Open

I saw something: PBF contains geometry outside bbox #290

missinglink opened this issue Dec 6, 2016 · 2 comments

Comments

@missinglink
Copy link
Member

heya, I keep finding elements outside the specified bbox in my ODES extracts.

as an example, I have an extract of the Wellington Region in New Zealand:
https://mapzen.com/data/metro-extracts/your-extracts/ddb7513ffe47

wellington

# download
wget https://s3.amazonaws.com/mapzen.odes/ex_cHKZYHrMJgXRy66PhSYeV4GmkifLC.osm.pbf -O wellington.pbf

# convert to plain text
osmconvert --out-osm wellington.pbf > wellington.osm

German entries:

$ grep "ß" -B10 wellington.osm | wc -l
8172
	<relation id="89120" version="9" timestamp="2015-02-07T16:45:27Z" changeset="28684786" uid="581934" user="powerpeanut">
...
		<tag k="network" v="Kreisstraßen Harburg"/>

Other entries:

I thought it might be because I live in Germany, but there also appears to be part of the China boundary in there for some reason!?

$ grep "\"270056\"" wellington.osm 
	<relation id="270056" version="514" timestamp="2016-06-19T11:12:57Z" changeset="40133511" uid="571410" user="Павел Гетманцев">

applying a bbox in osmconvert actually reduces the file size by ~15%

osmconvert -b="174.579,-41.454,175.063,-41.058" wellington.pbf --out-pbf > bbox.pbf

$ ls -lah *.pbf
-rw-rw-r-- 1 peter peter 5.7M Dez  6 11:11 bbox.pbf
-rw-rw-r-- 1 peter peter 6.7M Aug 12 22:06 wellington.pbf
@missinglink
Copy link
Member Author

missinglink commented Dec 6, 2016

I opened the extract up in QGIS and it gives the impression that it's correctly clipped, so I think it's only including invalid relations and not nodes or ways.

QGIS is likely silently ignoring the invalid relations because some/all their members are not present in the extract.

wellington

@migurski
Copy link
Contributor

migurski commented Dec 7, 2016

That’s… weird.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants