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

I need to know the population or buildings density at current point. I see there is a tag "population" and, 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

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

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


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.


permanent link

answered 03 May '20, 20:06

H_mlet's gravatar image

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

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 03 May '20, 19:04

question was seen: 1,701 times

last updated: 04 May '20, 21:34

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