GoogleLocationService problem getting latitude and longitude

-1

Follow the code:

Try 1: (It works)

var address = "Osasco - SP, Brasil";
var locationService = new GoogleLocationService();
var point = locationService.GetLatLongFromAddress(address);

Attempt 2: (Not working)

var address = "uol - Rua dos Autonomistas - Santa Paula, São Caetano do Sul - SP, Brasil";
var locationService = new GoogleLocationService();
var point = locationService.GetLatLongFromAddress(address);

Because on the second try, the variable point is null? Variable null point I can not get lat and long.

I've tried to get lat and long through this website . Same does not work with this name:

  

uol - Rua dos Autonomistas - Santa Paula, São Caetano do Sul - SP,   Brazil

By google maps official he finds lat and long: link

Any bright solution?

    
asked by anonymous 04.01.2017 / 01:00

1 answer

3

The API does not find anything because the address you are passing is "invalid."

Your address is invalid to the requested parameters because you are passing a part that is not part of the address, which is uol - . This part is the location you want (I believe), but it is not an address for the google API.

By Google Maps it locates because the system has a higher intelligence, so to speak, than the API itself. If you search the full address in google , you will find that you find a registered company, and with that the address is valid. For the API, searching by address, is not.

#

In this example the result is:

{
   "results" : [],
   "status" : "ZERO_RESULTS"
}

04.01.2017 / 12:42