Google Maps API Geocode not returning results on passing postal code as a value to address param
Asked Answered
P

2

6

On trying to search a particular address by postal code(2000) it does not return the expected formatted address correctly, but whereas on searching using the address(frederiksberg) instead of postal code it returns the expected formatted address correctly.

https://maps.googleapis.com/maps/api/geocode/json?address=2000&components=country:Denmark&key=apikey

https://maps.googleapis.com/maps/api/geocode/json?address=frederiksberg&components=country:Denmark&key=apikey

But for a similar search with address set to postal code(4000) it returns the expected formatted address correctly, url below.

https://maps.googleapis.com/maps/api/geocode/json?address=4000&components=country:Denmark&key=apikey

Please let us know why its not returning the expected formatted address for address set to 2000.

TIA!

Polypus answered 26/4, 2018 at 8:10 Comment(3)
I am also experiencing this issue.Chops
This is also an issue with other postcodes, i.e. 5000Chops
is "maps.googleapis.com/maps/api/geocode/json?" api paid or unpaidChristo
S
9

We experienced a similar issue with Postcode 2000 in Australia (which is Sydney), returned OK but with Zero_Result returned. All the other postcodes worked fine except 2000

Our initial search was

geocode({ address: "2000 Australia", region: "AU" })

We solving it by adding "Postcode" before the search

geocode({ address: "Postcode 2000 Australia", region: "AU" })

Significative answered 4/5, 2018 at 0:57 Comment(1)
Thanks a ton this solved the issue for me, I was also having the issue with Australia's postcode 2000.Republicanize
L
-2

The Zip code 2000 matches more than one address. You can get the most common ones this way:

https://geocode.xyz/2000?region=DK

output:

Denmark x,y z: 55.68132,12.52966

🇩🇰 3 Solbjerg Plads, Frederiksberg C, Denmark » Confidence Score: 0.5

  • Frederiksberg DK 2000 Denmark
  • Frederiksberg Kommune DK 2000 Denmark
  • Brønshøj DK 2000 Denmark
  • Bronshoj DK 2000 Denmark
  • Frederiksberg C DK 2000 Denmark

Or in json format:

https://geocode.xyz/2000?region=DK&json=1

Json Output:
{
"standard": {
"addresst": "3 Solbjerg Plads",
"stnumber": "3",
"prov": "DK",
"city": "Frederiksberg C",
"countryname": "Denmark",
"postal": "2000",
"confidence": "0.5"
},
"longt": "12.52966",
"alt": {
"loc": [
  {
    "longt": "12.51635",
    "city": "Frederiksberg",
    "cc": "6353",
    "latt": "55.68239"
  },
  {
    "longt": "12.51704",
    "city": "Frederiksberg Kommune",
    "cc": "5629",
    "latt": "55.68255"
  },
  {
    "longt": "12.50332",
    "city": "Bronshoj",
    "cc": "2",
    "latt": "55.67113"
  },
  {
    "longt": "12.50332",
    "city": "Bronshoj",
    "cc": "2",
    "latt": "55.67113"
  },
  {
    "longt": "12.52966",
    "city": "Frederiksberg C",
    "cc": "1",
    "latt": "55.68132"
  }
]
},
"latt": "55.68132"
}
Logic answered 26/4, 2018 at 16:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.