mapzen / metro-extracts

DEPRECATED. See readme for alternative ways to get "city-sized chunks" of OpenStreetMap data
ISC License
25 stars 27 forks source link

I saw something: PBF contains geometry outside bbox #290

Open missinglink opened 7 years ago

missinglink commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

That’s… weird.