Loading…
Tilbage

Profilbillede

Problem with road reverse geocoding

Dmytro Gokun

Hi,

we use road regent geocoding API as described here: http://dawa.aws.dk/dok/api/vejstykke#reverse

Recently, we started some strange behavior. Here's two example calls:

1) http://dawa.aws.dk/vejstykker/reverse?x=9.882763&y=56.014802&format=geojson&struktur=nestet

Result:


{
  ...,

  "properties": {
    ...

    "postal numbers": [
      {
         "href": "http://dawa.aws.dk/postnumre/8660",
         "nr": "8660",
         "name" : "Skanderborg"
      }
    ],

    ...
  }

}

 

2) http://dawa.aws.dk/vejstykker/reverse?x=9.797292&y=55.888282&format=geojson&struktur=nestet

 

Result:

 

{
  ...,

  "properties": {
     ...,

     "postnumer": [],

     ...
  }
}


As you can see, "postnumber" is empty in the second case. That's strange, as the road must be in some ZipCode, should not it? This looks like a bug to us.

 

Thanks in advance,

Dmytro Gokun

ændret af Dmytro Gokun (08.12.2018)

Hi Dmytro

The roads relation to zip codes are calculated based on address data. If a road doesn't have any addresses, there is no zip codes associated with the road. The "postnummer" contains which zip codes addresses on the road have. Dawa's focus is addresses.

To get a location zip codes use:

http://dawa.aws.dk/postnumre/reverse?x=9.797292&y=55.888282

Kind regards
Finn

 

Hi Finn,

thanks a lot for the explanation and advice (Y). I've implemented it and it works perfectly.

 

I have another small question here. If a road has addresses, how do I find the one closest to my point? I cannot see anything like "house number" in the output: http://dawa.aws.dk/dok/api/vejstykke#databeskrivelse

 

Best regards,

Dmytro.

Hi Dmytro

Use the reverse geocoding of adgangsadresser;

http://dawa.aws.dk/adgangsadresser/reverse?x=9.797292&y=55.888282

Perhaps the nearest adgangsadresse belongs to another road. In that case, check the adgangsadresse road name

Best regards
Finn