Finding a building's polygon

Dmytro Gokun

Hi all,

I'm trying to find a building closest to a given (lat, long) within some radius (say, 50 meters). For example, I want to examine point (57.45366, 10.019616). For that, I issue the following DAWA API request: 


The answer is:

  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:4326"
  "properties": {
    "id": "0a3f509a-6b07-32b8-e044-0003ba298018",
    "status": 1,
    "vejkode": "0768",
    "vejnavn": "Farøvej",
    "adresseringsvejnavn": "Farøvej",
    "husnr": "29",
    "supplerendebynavn": null,
    "postnr": "9800",
    "postnrnavn": "Hjørring",
    "kommunekode": "0860"

So, the coordinates of the building are (57.45294072, 10.02005771) which is ~84 meters away from the point i'm testing. But, if we look at the map:


we can see that the building is clearly within 50 meters to the point. The reason we get distance 84 meters is that the building coordinates are taken from its opposite side and the building is fairly big.

So, in fact, in order to find the correct distance from a point to a building, we need to know the building's polygon, not just one point. I was looking through DAWA API documentation, but was not able to find a way to obtain this information. Partly, because Danish is not my native language :).

Any help is greatly appreciated.

Best regards,


Hi Finn,

thanks for the quick answer. This API looks very much like what i need. The only thing that is missing is the building's address. I've tried https://dawa.aws.dk/bygninger/101771699, but that only returns zip code & city name, no street name/house number.

In fact, after some thinking: I may not need the building's polygon. What I really need is the "true" distance from my point to the building that takes into account the building's shape (polygon) and not just some arbitrary lat/lng within it. Also, I need the address of that building - at the end, the address is what I'm looking for here. If you think about it - that is how reverse geocoding should work: it should consider addresses as polygons and not as points + return the true distance (or have a "radius" parameter). 


Hi Dmytro

The building API gives you the access addresses (adgangsadresser) contained in the building's polygon. The access addresses (adgangsadresser) are not included in the "flat" format. You can use the parameter struktur=nested:


In your example, the building is not associated with any address, but if you look at, for example, this:


Not all buildings have an address, and not all addresses refer to a building.

Kind regards

ændret af Finn Jordal (05.11.2018)