Hello! I have a following issue, I need to calculate the area of a rooftop of a building that I have searched for (I am considering only flat roofs). By querying OSM through Nominatim https://nominatim.openstreetmap.org/search/${query}format=json&addressdetails=1&limit=1&polygon_svg=1 I got a result with the coordinates of the nodes of the building. And as I have understand I need to use lat and long of that nodes and calculate the area of rooftop (received polygon). Can you suggest some alternate (easier) methods for this task (is there a possibility to query OSM and get that area without calculating it)?

For example after querying I got this result: address: {house_number: "228", road: "Sõpruse pst", quarter: "Мустамяе", suburb: "Mustamäe linnaosa", city: "Tallinn", …} boundingbox: (4) ["59.400098", "59.4003983", "24.6893501", "24.6909638"] class: "building" display_name: "228, Sõpruse pst, Мустамяе, Mustamäe linnaosa, Tallinn, Таллин, Уезд Харьюмаа, 13414, Estonia" importance: 0.22100000000000003 lat: "59.400248149999996" licence: "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright" lon: "24.690156937993393" osm_id: 26871853 osm_type: "way" place_id: 93502864 svg: "M 24.6893501 -59.4002007 L 24.6893999 -59.400098 24.6909638 -59.4002956 24.6909274 -59.4003705 24.6909139 -59.4003983 Z" type: "yes"

asked 26 Oct '20, 18:10

armankulbek's gravatar image

accept rate: 0%

Nominatim imports full polygons for streets, landuse, cities, countries. For addresses Nominatim only imports the center point it doesn't import the building shape itself and thus can't return the size. If a building=yes is the address then during the import a center point is calculated and only that imported. When Nominatim returns a bounding box it's most likely calculated, e.g. "50 meter box around this center point". https://github.com/osm-search/Nominatim/blob/master/lib/PlaceLookup.php#L550

permanent link

answered 26 Oct '20, 18:20

mtmail's gravatar image

accept rate: 29%

Your answer
toggle preview

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](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:


question asked: 26 Oct '20, 18:10

question was seen: 745 times

last updated: 26 Oct '20, 18:20

powered by OSQA