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

Sorry I am new to this API. It's not very easy to learn. I've worked with API for 5 years and never seen something so confusing lol.

I'm trying to search a coordinate and find the building around it. So far I can search a coordinate and check if a feature is in it. But what I want to do is if it is not on that coordinate I want to be able to search 20 meter radius to check if it's there. So far my query looks like this. Below code will output the building at that coordinate, which works.

[out:json];
is_in(42.1214989,-88.4187053);
area._[building~"^(industrial|warehouse)$"];
(._;>;);
out geom;

I tried this code and can't get it to work. I tried 100 of different variants. I'm close.

[out:json];
area._[building~"^(industrial|warehouse)$"(around:200,42.1214989,-88.4187053);
(._;>;);
out geom;

asked 26 Oct '22, 21:55

KrisMapper's gravatar image

KrisMapper
26224
accept rate: 0%

edited 26 Oct '22, 22:02


way[building~"^(industrial|warehouse)$"](around:200,42.1214989,-88.4187053);
out geom;

Area does not work with around.

._ is the default set from the previous command, so it can't be used in the initial statement.

You were missing a closing square bracket.

I'm also still confused by area/is_in/around/pivot commands. for instance if you search for boundary using your first routine it returns data, but doesn't output them.

permanent link

answered 27 Oct '22, 16:28

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 27 Oct '22, 16:29

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:

×710
×483

question asked: 26 Oct '22, 21:55

question was seen: 1,064 times

last updated: 27 Oct '22, 16:29

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