You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2014-12-22 10:27:30

althio
Member
Registered: 2014-12-09
Posts: 36

Covering areas / enclosing polygons with API query is_in and JOSM

Is possible to download in JOSM the enclosing polygons (aka covering areas) of a particular point?
What would be the easiest workflow, either using API or directly in JOSM?

Overpass_API/Overpass_QL#Query_for_areas is_in wrote:

is_in returns the areas that cover the given coordinates (when specified) or one or more nodes from the input set (when no coordinates are specified).

http://wiki.openstreetmap.org/wiki/Over … 28is_in.29
Also see: http://stackoverflow.com/questions/2118 … g-polygons

Offline

#2 2014-12-23 10:26:27

stephan75
Member
Registered: 2008-05-28
Posts: 2,918

Re: Covering areas / enclosing polygons with API query is_in and JOSM

first be aware: the so called is_in tag is not used everywhere on the planet, and there are people who say that using is_in= is deprecated.

Do you mean something similar like the "New Query Feature" on osm.org that was implemented in Dez. 2014? https://blog.openstreetmap.org/2014/12/ … y-feature/

besides the tags of the map object itself, there is an output about all "areas" where it is located in.

As far as I know there is NO such feature in JOSM.

If you want such a feature, ask in JOSM mailing list or / and open a detailed feature request on JOSM trac system.

Offline

#3 2014-12-28 15:15:50

bastik
Member
Registered: 2011-08-05
Posts: 58

Re: Covering areas / enclosing polygons with API query is_in and JOSM

The Overpass  query would be something like

is_in(50.73322,7.09828);
relation(pivot);
(._;>;);
out meta;

You can copy this into Overpass turbo and click Export and raw data directly from Overpass API. Then rename the downloaded file to data.osm and open in JOSM.

There is also a plugin called mirrored downlaod which allows to enter Overpass queries directly in JOSM, but I don't know how it works.

Offline

#4 2015-01-06 16:58:36

althio
Member
Registered: 2014-12-09
Posts: 36

Re: Covering areas / enclosing polygons with API query is_in and JOSM

Thank you for your help, it is much appreciated.

stephan75 wrote:

first be aware: the so called is_in tag is not used everywhere on the planet, and there are people who say that using is_in= is deprecated.

I think the 'tag' is_in from OSM database and the 'Query for areas' is_in from Overpass API/Overpass QL are two different things. If I understand correctly I am interested in the Overpass query, not in the tag.

stephan75 wrote:

Do you mean something similar like the "New Query Feature" on osm.org that was implemented in Dez. 2014? https://blog.openstreetmap.org/2014/12/ … y-feature/
besides the tags of the map object itself, there is an output about all "areas" where it is located in.

Yes very similar. The query (example) provides Nearby features and Enclosing features. Enclosing features are just what I am looking for.

I was able to reproduce the same kind of queries with http://overpass-turbo.eu/s/6St

is_in(48.8610,2.3358);
out ids|body|meta;

I need now the last step to load the found objects into JOSM, as batch/automatic if possible. I could not do it when I tried to reproduce the method proposed by bastik. I could not export from Overpass to JOSM or run the Overpass Query from JOSM/File/Download with Overpass API.
If this is not possible at all, I would like to understand what is missing in order to open a clear feature request.

Offline

#5 2015-01-06 17:37:19

stephan75
Member
Registered: 2008-05-28
Posts: 2,918

Re: Covering areas / enclosing polygons with API query is_in and JOSM

Ok, I did mix up that thing with is_in ...

and indeed I have no usable result when running your short query in overpass-turbo ... it gives back only a kind of raw data, and no data display on the map ... when choosing the export feature to load the result in a running instance of JOSM with remote feature activated there, no daata is loaded in JOSM.

Looking in the raw data from overpass-turbo, it seems that all "areas" have an ID starting with 36... which is a sign for the internal number of areas in overpass-api.

See http://wiki.openstreetmap.org/wiki/Over … to_area.29 for details.

Offline

Board footer

Powered by FluxBB