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, 19:04 jujo0 |
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. answered 03 May, 20:48 H_mlet Thank you!
(03 May, 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, 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):
(04 May, 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, 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. answered 03 May, 20:06 H_mlet Could I somehow get the info about buildings including non-residential ones at some certain point, 1x1km square?
(03 May, 20:39)
jujo0
|