osmlab / fixing-polygons-in-osm

Fixing (multi)polygons in OpenStreetMap
25 stars 4 forks source link

Old-style + Empty relations ( no members ) #34

Closed ImreSamu closed 7 years ago

ImreSamu commented 7 years ago

Today : As I see ~80% of old-style.osm.pbf is empty relations.

The ~80% = ( 9878/10731) is calculated by this script:

wget http://area.jochentopf.com/download/old-style.osm.pbf
osmium cat old-style.osm.pbf --no-progress -t relation -f opl | wc -l
osmium cat old-style.osm.pbf --no-progress -t relation -f opl | grep " M$" | wc -l
$ osmium cat old-style.osm.pbf --no-progress -t relation -f opl | wc -l
10731
$ osmium cat old-style.osm.pbf --no-progress -t relation -f opl | grep " M$" | wc -l
9818

After analysing the 9818 empty relations in the old-style.osm.pbf , as I see :

So be careful! Don't blindly delete the relations based on old-style.osm.pbf

$ osmium cat old-style.osm.pbf --no-progress -t relation -f opl | grep " M$" | cut -d' ' -f8 | sort | uniq -c | sort -nr
   9714 Ttype=multipolygon
     25 Ttype=multipolygon,source=Dundagas%20%novada%20%Dundagas%20%pagasta%20%teritorijas%20%plānojuma%20%2004.%2013%2016.%20%gadam%20%grozījumu%20%grafiskā%20%daļa%20%un%20%teritorijas%20%izmantošanas%20%un%20%apbūves%20%noteikumi%2c%%20%28.08.2014.%20%domes%20%sēdes%20%lēmums%20%nr.%20%229%20%(25.%20%§)
     13 Ttype=multipolygon,source=Bing
      7 Ttype=multipolygon,building=yes
      5 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%21:59:26%20%01/30/11%20%(pc_PL/UMP-Bialystok/src/BIALYSTOK.zielone.txt)
      5 Tsource=Bing,type=multipolygon
      4 Ttype=multipolygon,source=bing
      3 Ttype=multipolygon,source=Microsoft%20%Bing%20%orbital%20%imagery
      3 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%04:25:45%20%09/08/09%20%(UMP-Ciechanow/src/CIECHANOW.zielone.txt)
      3 Tnote=TODO:%20%fix%20%roles%20%manually,type=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%11:18:52%20%11/17/09%20%(UMP-Tarnow/src/TARNOW.zielone.txt)
      2 Ttype=restriction
      2 T
      1 Ttype=multipolygon,waterway=riverbank
      1 Ttype=multipolygon,water=lake,natural=water
      1 Ttype=multipolygon,source=survey
      1 Ttype=multipolygon,source=interpolation
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%21:08:14%20%04/11/10%20%(UMP-Lodz/src/LODZ.zielone.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%21:06:39%20%06/12/09%20%(UMP-Kielce/src/KIELCE.zielone.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%18:43:59%20%09/30/09%20%(UMP-Kalisz/src/KALISZ.zielone.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%16:02:22%20%01/18/10%20%(UMP-Suwalki/src/SUWALKI.granice.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%11:01:43%20%04/03/09%20%(UMP-Zamosc/src/ZAMOSC.zielone.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%04:25:58%20%09/08/09%20%(UMP-Ciechanow/src/CIECHANOW.zielone.txt)
      1 Ttype=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%00:11:16%20%02/04/11%20%(pc_PL/UMP-Bialystok/src/BIALYSTOK.zielone.txt)
      1 Ttype=multipolygon,source=GSI/KIBAN%20%2500;%20%NARO
      1 Ttype=multipolygon,source=Geodatastyrelsen%20%:%20%FOT
      1 Ttype=multipolygon,source=cadastre-dgi-fr%20%source%20%:%20%Direction%20%Générale%20%des%20%Impôts%20%-%20%Cadastre.%20%Mise%20%à%20%jour%20%:%20%2012
      1 Ttype=multipolygon,source=basemap.at
      1 Ttype=multipolygon,landuse=forest,leaf_type=leafless,leaf_cycle=deciduous
      1 Ttype=multipolygon,landuse=forest
      1 Tsource=CanVec%20%6.0%20%-%20%NRCan,type=multipolygon
      1 Tsource=3dShapes,type=multipolygon
      1 Tnote=Школа%20%%2116%26,type=multipolygon
      1 Tnote=контур%20%полный%20%без%20%крыши%20%для%20%редактирования,type=multipolygon
      1 Tnote=Task%20%Manager%20%job%20%for%20%Ebola%20%outbreak%2c%%20%in%20%Kailahun%20%district,type=multipolygon
      1 Tnote=relation%20%task%20%manager%20%mopti-gao,type=multipolygon
      1 Tnote=outer%20%border%20%of%20%the%20%water,type=multipolygon
      1 Tnote=FIXME:%20%fix%20%roles%20%manually,type=multipolygon,source=http://ump.waw.pl/%20%retrieved%20%00:11:16%20%02/04/11%20%(pc_PL/UMP-Bialystok/src/BIALYSTOK.zielone.txt)
      1 Tname=Ессей,type=boundary,place=village
      1 Tname=Multipoligono%20%Zelaya,type=multipolygon
      1 Tname=Laramie%20%River,type=multipolygon
      1 Tname=Archivio%20%di%20%Stato,type=multipolygon,building=yes
      1 Tlanduse=meadow
      1 Tlanduse=farmland
      1 Tarea=yes,name=Aduana%20%terrestre%20%La%20%hachadura,type=multipolygon,highway=services

What is the best method to clean the "Old-style empty relations" ?

joto commented 7 years ago

Good point @ImreSamu . I will remove the relations without members from the old-style file. This is something we need to deal with separately.

sebastic commented 7 years ago

You can keep them in the old-style file too, since all the existing issues have been fixed. Only newly created old-style multipolygons are still included in the daily updates of the file.