1

I am working on an aplication that parses a list of addresses and gets their geolocation, in order to perform a proximity search.

I am using the GoogleMaps API v3 and the Google geocoder.

The problem that I am facing has to do with a specific address:

Address: Nieuwe Haven 233

Postcode: 3117 AB

City: Schiedam

Country: Netherlands

So to the point. Using google maps in my browser if I search for the above address everything works fine. Here is a link

When I use the Geocoder to get the location I get the center of this City and not the address.

Example: http://maps.googleapis.com/maps/api/geocode/json?address=Nieuwe+Haven++233%2C+%EF%BB%BFSchiedam%2C+Netherlands&sensor=false

Why is this happening. What am I missing on the geocoder ?

Thanks in advance guys!

1 Answer 1

1

You are using bad unicode space before city.

http://maps.googleapis.com/maps/api/geocode/json?address=Nieuwe+Haven+233%2C+%EF%BB%BFSchiedam%2C+Netherlands&sensor=false

%EF%BB%BF - this is the problem.

http://maps.googleapis.com/maps/api/geocode/json?address=Nieuwe+Haven+233%2C+Schiedam%2C+Netherlands&sensor=false

This is correct url format.

Sign up to request clarification or add additional context in comments.

2 Comments

@Petr B. What about this one: maps.googleapis.com/maps/api/geocode/… Am I able to put the o-umlaut in the URL using %D6, or should I convert it to O-without-umlaut?
MALM%C3%96%20SWEDEN It's better to use urlEncode on your query string (%C3%96 = Ö). It's because api use UTF-8 encoding and not UTF-16 (0xC3 0x96 = 0x00D6). And google geocoding is clever enough to find city with or without umlaut.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.