I need to know the population or buildings density at current point. I see there is a tag "population" and osm-analytics.org, but how can I ask in js to get information about the density, say 1km2 around some chosen point? Thanks!

asked 03 May '20, 19:04

jujo0's gravatar image

jujo0
16225
accept rate: 0%


I guess you want to read about the Overpass API, for this kind of queries.

Please use overpass turbo to test your queries.

This query will return all the buildings in the viewing bbox. I leave you to calculate a fitting 1km bounding box around some point. Don't forget that in urban areas, it will mean a lot of data !

If you don't need the geometry of each building, center will help you, like in this query. Overpass is a very powerful language...

Some background in this question.

permanent link

answered 03 May '20, 20:48

H_mlet's gravatar image

H_mlet
4.9k1575
accept rate: 13%

Thank you!

(03 May '20, 20:53) jujo0

No problem. Please mark the answer as accepted if it suits you.

Don't hesitate to ask more specific questions later.

(03 May '20, 22:08) H_mlet

I tried to make a rectangle, +/-0.0018 deg (~200m) from some point, but poly keeps on being triangular. Is it a normal behaviour? My query looks like this (I must have changed dots to commas for the code to appear normally): [out:json][timeout:25]; // gather results ( // query part for: “building” way["building"](poly:"52.209156623640474 18.2667298038213 52.245156623640476 18.2667298038213 52.209156623640474 18.230729803821298 52.209156623640474 18.2667298038213"); //relation["building"](poly:"52.22661090011143 18.259625256876017 52.22661090011143 18.25602525687602 52.22661090011143 18.259625256876017 52.23021090011144 18.259625256876017"); ); out center;

(04 May '20, 21:17) jujo0

I don't understand your problem, I guess the code isn't complete. The simplest is to Share an url to overpass turbo IMHO.

But I would have computed the bounding box in JS, before creating the query.

(04 May '20, 21:24) H_mlet

Hello,

Short answer is, the information is not in OSM.

The tag population is mostly here to know how to sort the cities, to show the biggest ones' labels first. It's usually not really up-to-date or precise.

You could make an educated guess from the number (and size) of buildings, but you'll have to filter out non-residential buildings.

I'm afraid you'll have to turn to other sources for your query.

Regards.

permanent link

answered 03 May '20, 20:06

H_mlet's gravatar image

H_mlet
4.9k1575
accept rate: 13%

Could I somehow get the info about buildings including non-residential ones at some certain point, 1x1km square?

(03 May '20, 20:39) jujo0
Your answer
toggle preview

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:

×5
×1

question asked: 03 May '20, 19:04

question was seen: 1,060 times

last updated: 04 May '20, 21:34

powered by OSQA