NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Is it possible to create an area, as part of an Overpass query, for an arbitrary multypolygon relation?

Overpass does not create areas for multipolygons that have no name or postal code, according to areas.osm3s.

For example, I'd like to find all orphan nodes in the area defined by relation 6195356.

If this relation had a built-in area, the Overpass query would be:

  node (area:3606195356);     // Find all nodes in multipolygon
  (._; - (way(bn);node(w));); // Remove nodes used by ways
  (._; - node._[~"."~"."];);  // Remove nodes with tags
  (._; - (rel(bn);node(r));); // Remove nodes used by relations
  out meta qt geom;

The requested solution would be Overpass Query statement(s) that will replace node (area:3606195356);

asked 08 Dec '17, 10:58

zstadler's gravatar image

zstadler
116358
accept rate: 0%

closed 11 Dec '17, 17:58

The short and sad answer is it is not possible:

... you as a user cannot influence the area creation process by sending queries to the server. It's all defined in the area creation rules, see Overpass_API/Areas Mmd (talk) 17:22, 9 December 2017 (UTC)

Ref: - https://wiki.openstreetmap.org/wiki/Overpass_API/status - https://wiki.openstreetmap.org/wiki/Overpass_API/Areas

(11 Dec '17, 17:57) zstadler

The short and sad answer is it is not possible:

... you as a user cannot influence the area creation process by sending queries to the server. It's all defined in the area creation rules, see Overpass_API/Areas Mmd (talk) 17:22, 9 December 2017 (UTC)

Ref: https://wiki.openstreetmap.org/wiki/Overpass_API/status

(11 Dec '17, 18:01) zstadler

There's a map_to_area operation that creates an area:

http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Map_way.2Frelation_to_area_.28map_to_area.29

The documentation only says that the operation returns the area associated with the OSM object but it also appears to create it if it doesn't exist. I'm not sure how persistent the new areas are, but at the moment there is an area associated with that relation on the overpass-api.de server, apparently due to my experimenting.

permanent link

answered 08 Dec '17, 12:43

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 08 Dec '17, 12:44

Unfortunately, this does not seem to work for the relation at hand. The following Overpass query returns nothing:

    rel(6195356);
    map_to_area;
    out;
(08 Dec '17, 14:58) zstadler

Could be server specific. Here it returns an area: http://overpass-turbo.eu/s/tEL

(with overpass-api.de selected in the settings)

(08 Dec '17, 16:22) maxerickson

Here's the output I get clicking your first link:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2017-12-09T00:25:02Z" areas="2017-12-08T23:26:03Z"/>

  <area id="3606195356">
    <tag k="name" v="Israel and Palestine"/>
    <tag k="name:de" v="Israel und Palästina"/>
    <tag k="name:en" v="Israel and Palestine"/>
    <tag k="note" v="Do not delete!"/>
    <tag k="type" v="multipolygon"/>
  </area>

</osm>
(09 Dec '17, 00:28) maxerickson

Here is what I get:

    <?xml version="1.0" encoding="UTF-8"?>
    <osm version="0.6" generator="Overpass API 0.7.54.12 054bb0bb">
    <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
    <meta osm_base="2017-12-09T06:15:02Z" areas="2017-12-09T05:42:02Z"/>

    </osm>

Also note the difference in the "generator" text.

Strange indeed.

(09 Dec '17, 06:19) zstadler

There seems to be a difference between the two servers behind overpass-api.de

> wget -q -O - http://178.63.48.217/api/interpreter?data=rel%286195356%29%3Bmap_to_area%3Bout%3B
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.54.12 054bb0bb">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2017-12-09T06:34:02Z" areas="2017-12-09T05:42:02Z"/>

</osm>

> wget -q -O - http://136.243.42.136/api/interpreter?data=rel%286195356%29%3Bmap_to_area%3Bout%3B
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2017-12-09T06:34:02Z" areas="2017-12-09T05:21:02Z"/>

  <area id="3606195356">
    <tag k="name" v="Israel and Palestine"/>
    <tag k="name:de" v="Israel und Palästina"/>
    <tag k="name:en" v="Israel and Palestine"/>
    <tag k="note" v="Do not delete!"/>
    <tag k="type" v="multipolygon"/>
  </area>

</osm>
(09 Dec '17, 06:40) zstadler
2

Apparently, the result provided the by "z.overpass-api.de" server (136.243.42.136), which contains the area element, is outdated. See this comment for GitHub issue 285 and a 9-Dec-2017 server issue report.

(09 Dec '17, 17:44) zstadler

It seems like the old areas were also removed from the "z.overpass-api.de" server (136.243.42.136):

> wget -q -O - http://z.overpass-api.de/api/interpreter?data=rel%286195356%29%3Bmap_to_area%3Bout%3B

<osm version="0.6" generator="Overpass API 0.7.54.12 054bb0bb">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2017-12-11T09:57:02Z" areas="2017-12-11T08:55:02Z"/>

</osm>

The question remains open

(11 Dec '17, 10:00) zstadler
showing 5 of 8 show 3 more comments

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×213
×132
×65

question asked: 08 Dec '17, 10:58

question was seen: 4,108 times

last updated: 11 Dec '17, 18:13

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum