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

There are two nearby state forests, "A" and "B". When I use Query Features in OSM, and select a feature like a road or path inside "A", the sidebar includes the state forest "A" as an Enclosing Feature. But when I do the same thing with a feature inside "B", it does not list "B" as an enclosing feature.

I would like to fix "B", so I looked closer at the features and tags.

Both "A" and "B" are closed ways, with landuse=forest and a name. But "A" is the outer-role member of a multipolygon relation, and B is not a member of a relation. That is the only difference. So it seems to me that being a member of a multipolygon relation makes the way a candidate for being an enclosing feature.

Other features I see listed under Enclosing Features are administrative boundaries (with or without multipolygons), so it seems that type=boundary and/or boundary=administrative also makes a closed way appear as an enclosing feature.

Am I right about this? Is there documentation on what causes a closed Way to be listed as an enclosing feature? (I couldn't find anything on the OSM wiki.)

asked 13 Feb '16, 03:22

ljb_nj's gravatar image

ljb_nj
659101727
accept rate: 12%

edited 13 Feb '16, 08:22

scai's gravatar image

scai ♦
33.3k21309459

It would help us a lot understanding your issue if you could provide links to "A" and "B".

(14 Feb '16, 08:54) scai ♦

The enclosing features are area features coming from http://overpass-api.de/ .

There is some discussion here:

http://wiki.openstreetmap.org/wiki/Overpass_API/Areas

I think a landuse=forest should create an area, but maybe it hasn't been generated yet. I used the script below to find out that areas were last generated 2 days ago. Is the feature newer than that?

This is about the simplest script that will return an area:

http://overpass-turbo.eu/s/eo7

The timestamp is returned in the output, Overpass Turbo does the math and displays it if you hover over the statistics on the lower right.

permanent link

answered 13 Feb '16, 04:27

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

edited 13 Feb '16, 04:36

1

According to the script that generates the areas (areas.osm3s) multipolygon relations are only considered if they have a name tag. This name tag requirement also applies to some other objects (e.g. relations tagged with admin_level or boundary, various ways with certain tags) but not all of them (e.g. relations with postal_code or addr:postcode tag). But that doesn't mean that people should start adding wrong name tags.

(13 Feb '16, 08:21) scai ♦

Thanks for the info. The link lead me to this textual description of what makes a way into a polygon (area): http://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features

According to that, landuse=forest on a closed loop way without area=no makes a polygon. But I know that isn't working as far as "enclosing features" goes. I also looked at the area3.osm3s script. With my very limited understanding of it, I see it does use landuse (other than no), with name, and not area=no to make a polygon. I also see the script considers a multipolygon to be a polygon but only if it has a name, and the one ("A" above) does not, yet it does work as an enclosing feature.

I'm going to try to fix my case "B" above - to make it like "A" and see what happens. As much as I would like to understand what is happening, I'm OK with fixing the feature and moving on.

(13 Feb '16, 23:07) ljb_nj

This is very strange, and I obviously don't know what is going on. But after looking at it some more, the problem isn't that the State Forests don't show as Enclosing Features. The problem is that nothing shows as enclosing features. This is happening for large areas of Southern New Jersey, such as here: http://www.openstreetmap.org/#map=15/39.6176/-74.5007

When I use Query Features on a road there, I see no Enclosing Features at all. But further south, I see at least a County, State, and Country as Enclosing Features.

Something seems to be blocking it from working there. I thought maybe it was the Pinelands National Reserve area ( http://www.openstreetmap.org/way/33832747 ) which is a huge closed way that surrounds this (tags: area=yes, boundary=national_park) but that doesn't seem to be the cause. Enclosing Features works in some places inside this area.

(15 Feb '16, 03:10) ljb_nj

A script like this, with the coordinates copied from a failed query:

is_in(39.6883,-74.4133);
out;

(try it here)

Succeeds, so the problem does not seem to be the existence of the areas on the Overpass API server.

Firefox reports an error on the blank results TypeError: e.bounds is undefined, and not on successful results. So the issue is probably in the JS code powering the query feature. Not sure where to begin debugging that, maybe in https://github.com/openstreetmap/openstreetmap-website/blob/master/app/assets/javascripts/index/query.js

(15 Feb '16, 15:14) maxerickson

maxerickson: I think you have figured it out. The areas are OK, but the problem is with the browser and the query. I am seeing almost the same thing: "Error: TypeError: t.bounds is undefined", "Source File: http://www.openstreetmap.org/assets/..." in my browser. (Using either Firefox or Seamonkey browsers.)

But I suppose it still could be something in the map data that triggers this, which would explain why it only happens in some areas.

(15 Feb '16, 23:31) ljb_nj
2

I created a ticket for this issue now: https://github.com/openstreetmap/openstreetmap-website/issues/1156

Please follow up there.

(16 Feb '16, 19:33) mmd
showing 5 of 6 show 1 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
×92

question asked: 13 Feb '16, 03:22

question was seen: 5,419 times

last updated: 16 Feb '16, 19:34

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