User:Hansm/Boundary statistics
Here are some statistics about the usage of relation tag "type=boundary". All relate to the planet.osm dump from 2009-07-13.
Boundaries that osm2pgsql converts as pg POLYGON
Except "boundary=yahoo".
relation | way | admin_level | boundary | name |
---|---|---|---|---|
57537![]() |
6 | administrative | Cornwall | |
62269![]() |
2 | administrative | Isle of Man | |
28489604![]() |
national_park | Dartmoor National Park | ||
87944![]() |
6 | administrative | Swansea | |
134324![]() |
6 | administrative | Powys | |
10187![]() |
6 | administrative | Herefordshire | |
151283![]() |
4 | administrative | West Midlands | |
57511![]() |
6 | administrative | Shropshire | |
82631![]() |
6 | administrative | South Gloucestershire | |
57581![]() |
6 | administrative | Worcestershire | |
57515![]() |
6 | administrative | Staffordshire | |
153487![]() |
6 | administrative | Cheshire East | |
149122![]() |
8 | administrative | Pendle | |
151012![]() |
4 | administrative | Yorkshire and the Humber | |
150871![]() |
8 | administrative | Richmondshire | |
151164![]() |
4 | administrative | North East England | |
88066![]() |
6 | administrative | Northumberland | |
31787677![]() |
national_park | New Forest National Park | ||
151279![]() |
4 | administrative | East Midlands | |
108100![]() |
8 | administrative | Derbyshire Dales | |
88077![]() |
6 | administrative | Derbyshire | |
118323![]() |
8 | administrative | Bradford | |
88079![]() |
6 | administrative | West Yorkshire | |
154376![]() |
6 | administrative | Tyne and Wear | |
142282![]() |
6 | administrative | Newcastle upon Tyne | |
127238![]() |
8 | administrative | Winchester | |
76228![]() |
6 | administrative | Hampshire | |
76155![]() |
6 | administrative | Oxfordshire | |
63375![]() |
6 | administrative | Northamptonshire | |
58414![]() |
10 | administrative | Morton Pinkney | |
77270![]() |
8 | administrative | Bassetlaw | |
135523![]() |
8 | administrative | Selby | |
150966![]() |
8 | administrative | Hambleton | |
114677![]() |
8 | administrative | Chichester | |
113757![]() |
6 | administrative | West Sussex | |
88082![]() |
6 | administrative | Bedfordshire | |
158396![]() |
6 | administrative | Bedford | |
57398![]() |
6 | administrative | Rutland | |
145223![]() |
8 | administrative | Veulette-sur-Mer | |
92650![]() |
6 | administrative | East Sussex | |
62162![]() |
6 | administrative | Essex | |
76488![]() |
8 | administrative | Castle Point | |
53337![]() |
8 | administrative | St Edmundsbury | |
57397![]() |
6 | administrative | Norfolk | |
53332![]() |
8 | administrative | Mid Suffolk District | |
(45 rows) |
All administrative boundaries are derived from relations with tag "type=boundary". The only boundary POLYGONs derived from ways are national_parks.
Furthermore, there are 1164 boundaries in talbe planet_osm_line and 1135 in table planet_osm_roads. Both seem to be more or less the same. Both tables contain roughly half of the rows derived from ways and the other half derived from relations. Boundary relations seem to be widely used in the UK and in France.
Relations with "type=boundary" in relation clusters
In the actual OSM DB (not what osm2pgsql has generated from it), there are 26928 relations with "type=boundary". 259 of them are part of a relation cluster, i.e. a relation that contains some of this relations. With high probability, this means that they don't enclose an area. 157 relation clusters contain sub-relations tagged as "type=boundary".
"type" tags used in this relation clusters:
type | count | remark |
---|---|---|
address | 127 | relation names look Russian |
boundary | 19 | mainly used in France, Germany, Austria, Switzerland |
multipolygon | 3 | 17775![]() ![]() ![]() |
state | 3 | |
county | 2 | |
country | 1 | |
null | 1 | |
nation | 1 |
Super relations containing relations with "type=boundary"
7374 7374,
7424
7424,
7435
7435,
7885
7885,
7886
7886,
7887
7887,
11980
11980,
16163
16163,
16438
16438,
17775
17775,
22956
22956,
23169
23169,
26880
26880,
28245
28245,
29956
29956,
51684
51684,
51701
51701,
51908
51908,
54422
54422,
56392
56392,
78655
78655,
78967
78967,
79842
79842,
79843
79843,
79844
79844,
79845
79845,
79846
79846,
79847
79847,
79848
79848,
79849
79849,
79852
79852,
79853
79853,
79854
79854,
79855
79855,
79856
79856,
79857
79857,
79858
79858,
79859
79859,
79860
79860,
79895
79895,
79897
79897,
79898
79898,
79900
79900,
79902
79902,
79904
79904,
79906
79906,
79907
79907,
79908
79908,
79909
79909,
79910
79910,
79912
79912,
79913
79913,
79914
79914,
79916
79916,
79917
79917,
79918
79918,
79919
79919,
79920
79920,
79921
79921,
79922
79922,
79924
79924,
79925
79925,
79926
79926,
79927
79927,
79929
79929,
79930
79930,
79931
79931,
79932
79932,
79933
79933,
79934
79934,
79935
79935,
79937
79937,
79940
79940,
79941
79941,
79942
79942,
79943
79943,
79944
79944,
79945
79945,
79946
79946,
79947
79947,
79948
79948,
79949
79949,
79952
79952,
79953
79953,
79954
79954,
79956
79956,
79958
79958,
79959
79959,
79960
79960,
79962
79962,
79963
79963,
79964
79964,
79965
79965,
79966
79966,
79967
79967,
79968
79968,
79969
79969,
79970
79970,
79971
79971,
79972
79972,
79973
79973,
79974
79974,
79976
79976,
79978
79978,
79983
79983,
79984
79984,
79985
79985,
79986
79986,
79987
79987,
79988
79988,
79989
79989,
79990
79990,
79991
79991,
79992
79992,
79993
79993,
79995
79995,
79996
79996,
79997
79997,
79998
79998,
79999
79999,
80000
80000,
80001
80001,
80002
80002,
80003
80003,
80004
80004,
80007
80007,
80008
80008,
80010
80010,
80011
80011,
80012
80012,
80013
80013,
80014
80014,
80015
80015,
80016
80016,
80017
80017,
80018
80018,
80019
80019,
80020
80020,
80022
80022,
80025
80025,
80026
80026,
80028
80028,
80029
80029,
80030
80030,
80031
80031,
80033
80033,
80035
80035,
80096
80096,
80488
80488,
82728
82728,
82743
82743,
82765
82765,
82767
82767,
102879
102879,
135579
135579,
161349
161349,
162784
162784
Sub-relations with "type=boundary"
7426 7426,
7723
7723,
7885
7885,
7886
7886,
16354
16354,
16483
16483,
17511
17511,
17529
17529,
17560
17560,
17567
17567,
17580
17580,
17601
17601,
17605
17605,
17623
17623,
17632
17632,
17633
17633,
17641
17641,
17644
17644,
17645
17645,
17655
17655,
22233
22233,
22733
22733,
22735
22735,
26221
26221,
26222
26222,
26907
26907,
26923
26923,
28245
28245,
28322
28322,
29713
29713,
29714
29714,
29715
29715,
29716
29716,
29724
29724,
29726
29726,
29731
29731,
29736
29736,
29750
29750,
29773
29773,
29784
29784,
29787
29787,
29788
29788,
29925
29925,
29939
29939,
29948
29948,
31257
31257,
47393
47393,
47442
47442,
47505
47505,
47626
47626,
47773
47773,
47803
47803,
47812
47812,
51239
51239,
51250
51250,
51322
51322,
51326
51326,
51333
51333,
51334
51334,
51339
51339,
51410
51410,
51419
51419,
51440
51440,
51441
51441,
51442
51442,
51443
51443,
51444
51444,
51781
51781,
51793
51793,
51800
51800,
51806
51806,
51814
51814,
51821
51821,
51827
51827,
51831
51831,
51841
51841,
51848
51848,
51902
51902,
51903
51903,
51905
51905,
51906
51906,
51907
51907,
51909
51909,
53957
53957,
59065
59065,
59092
59092,
59137
59137,
59148
59148,
59149
59149,
59161
59161,
59162
59162,
59167
59167,
59178
59178,
59188
59188,
59189
59189,
59190
59190,
59195
59195,
59199
59199,
59202
59202,
59208
59208,
59209
59209,
59246
59246,
59249
59249,
59250
59250,
59252
59252,
59257
59257,
59273
59273,
59275
59275,
59415
59415,
59417
59417,
59418
59418,
59419
59419,
59504
59504,
59506
59506,
59752
59752,
59755
59755,
62145
62145,
65595
65595,
65598
65598,
65606
65606,
66113
66113,
69554
69554,
70542
70542,
70549
70549,
70561
70561,
70563
70563,
70565
70565,
70568
70568,
70569
70569,
70575
70575,
70577
70577,
70580
70580,
70586
70586,
70589
70589,
70591
70591,
70595
70595,
70602
70602,
70604
70604,
70605
70605,
70610
70610,
70614
70614,
70616
70616,
70618
70618,
70620
70620,
70626
70626,
70637
70637,
70638
70638,
70639
70639,
70649
70649,
70656
70656,
70660
70660,
70662
70662,
70665
70665,
70668
70668,
70669
70669,
70671
70671,
70676
70676,
70677
70677,
70679
70679,
70680
70680,
70684
70684,
70690
70690,
70691
70691,
70701
70701,
70703
70703,
70707
70707,
70716
70716,
70719
70719,
70721
70721,
70725
70725,
70727
70727,
70728
70728,
70732
70732,
70737
70737,
70746
70746,
70747
70747,
70748
70748,
70749
70749,
70751
70751,
70752
70752,
70754
70754,
70768
70768,
70772
70772,
70790
70790,
70795
70795,
70798
70798,
70799
70799,
70801
70801,
70809
70809,
70810
70810,
70812
70812,
70814
70814,
71093
71093,
71094
71094,
71097
71097,
71100
71100,
71101
71101,
71105
71105,
71112
71112,
71114
71114,
71116
71116,
71117
71117,
71118
71118,
71119
71119,
71121
71121,
71124
71124,
71125
71125,
71128
71128,
71130
71130,
71132
71132,
71133
71133,
71134
71134,
71135
71135,
71138
71138,
71145
71145,
71147
71147,
71149
71149,
75767
75767,
82622
82622,
82629
82629,
82675
82675,
82682
82682,
82722
82722,
82729
82729,
82751
82751,
82766
82766,
82773
82773,
82775
82775,
82779
82779,
89489
89489,
90124
90124,
90162
90162,
90333
90333,
90340
90340,
90341
90341,
90348
90348,
90352
90352,
102647
102647,
102666
102666,
102877
102877,
102882
102882,
102885
102885,
102896
102896,
102898
102898,
103060
103060,
126410
126410,
130921
130921,
131862
131862,
161349
161349,
163244
163244
Relations with "admin-level" tag set
In the actual OSM DB (not what osm2pgsql has generated from it), there are 47825 relations with "admin-level" tag set.
"boundary" values used together with "admin-level":
boundary | count |
---|---|
administrative | 47497 |
historic | 20 |
national_park | 1 |
maritime | 1 |
typos | 35 |
obvious nonsense | 3 |
"type" values used together with "admin-level":
type | count |
---|---|
boundary | 26679 |
multipolygon | 21050 |
municipality | 29 |
county | 12 |
amt | 10 |
typos | 7 |
commune | 6 |
border | 4 |
state | 1 |
collection | 1 |
boundary_incomplete | 1 |
Conclusion
Although osm2pgsql tries to generate PostGIS POLYGONS from boundaries, in fact the result is very poor. 45 polygons in relation to 26928 relations with "type=boundary" or 47825 relations with "admin-level" tag set, osm2pgsql's success rate is very close to 0.
Among administrative boundaries, the usage of "type=boundary" and "type=mulitpolygon" is about half-half.
There are only 259 relations with "type=boundary" that are part of a relation cluster. I don't understand the usage in relation clusters with "type=address", but this is the vaste majority. Only 29 are used in clusters with type values that look like administrative units. Mostly, this are high level units (with admin_level <= 4).
An alternate importer tries to fix several issues related to polygons in OSM data for GIS analysis, see osm2postgresql.