This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How can I dissolve intersecting polygons with Overpass?

2
1

I want to create one polygon of these 3:

[out:json];
(
  area["name:nl"="Antwerpen"]["admin_level"=6];
  area["name:nl"="Limburg"]["admin_level"=6];
  area["name:nl"="Vlaams-Brabant"]["admin_level"=6];
) ->.a;
rel(area.a)["admin_level"=6];
out meta;
way(r);
out geom;

So the ways that are shared should be removed so it would be one area. Any way I could do this with Overpass?

Thanks, Frans

asked 19 May '15, 14:44

_Frans_'s gravatar image

_Frans_
46113
accept rate: 0%


2 Answers:

5

Overpass API can't to this for you, but you could run the following Overpass API query in QGIS via QuickOSM plugin and merge the resulting polygons according to the description below.

[out:json];
(
  area["name:nl"="Antwerpen"]["admin_level"=6];
  area["name:nl"="Limburg"]["admin_level"=6];
  area["name:nl"="Vlaams-Brabant"]["admin_level"=6];
) ->.a;
(rel(area.a)["admin_level"=6];>;);out meta;

To merge intersecting polygons in QGIS, first select all polygons, then choose "Vector->Geoprocessing Tools->Dissolve" and dissolve by field "osm_type". Save the result in a new shape file and the result to your map. A new layer with a new multilinestring should appear like in the screenshot below.

Please see the following link for details. Here's how the result could look like with a bit of shapeburst styling:

alt text

answered 19 May '15, 16:10

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 19 May '15, 20:48

1

Thanks, this solved my problem!

(21 May '15, 13:58) _Frans_
1

Thanks for answer, this helped me very much.

(03 May '16, 16:22) Chriss85

0

You can try the webservice from OSM user Wambacher:

https://wambachers-osm.website/boundaries/

and try the "Union" feature at the bottom of the screen after selecting some boundary elements from the tree structure on the left. Then try to export in the format you need.

answered 23 May '15, 19:03

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

edited 05 Jul '17, 08:12

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273

Source code available on GitHub .