Hello all!

I've tried with curl, file_get_contents, and simpelxml (this is all
php) but generally speaking this is what i'm witnessing:

Occasionally when I type communicate to the google url:

http://maps.google.com/maps/geo?q= <my query, key, UTF encoding, etc
here>

I sometimes get odd results. Let me state two examples I just tried
today.


"upper sheep pasture road setauket ny"
"wellwood avenue lindenhurst ny"


Case 1. Now, the first query using my script received an error when i
tried to use curl (or simplexml, or any  method at all!), in that the
curl data returned was BLANK (that's right, it was ""). Since my next
line of code tries to parse "" as xml, it errors. What was interesting
was I found out that the address isn't just setauket for the city, but
rather EAST setauket. I notice if i copy the above url into my browser
(with just setauket) google automatically corrects it in the XML
returned as EAST SETAUKET, and gives me my long/lat. If I try it using
my script, however, I get "". It seems like i'm not getting anything
back, rather than a corrected result in my browser.  If i either send
it correctly to google (i.e. east setauket) or if i KEEP sending it
over and over (4-5 times let's say) i'll get my result. Why would
multiple requests eventually work?

Case 2. Google didn't auto correct (in the xml) 'wellwood avenue
lindenhurst ny', because it was a correctly spelled address, however I
still got a blank back from my curl call. Keep in mind i'm not always
getting this - 85% of the time i get a result back in my script, so
it's not like it works or doesn't work. It's flakey. Regardless, in
contradiction to case # 1 above, the address I provided was correct
and returned "" anyway. If i try in a browser it works all the time.

Is anyone aware of things like this occuring with regards to
programming? I understand a browser is somewhat different than a curl
call, however I am using settings such as setting my headers (brower
user agent etc) and generally it works in PHP.

Shouldn't google return me a 602 error or 610 or something other than
""  if there is something amiss? I understand google isn't the problem
but i'm curious if anyone has experienced situations like this in
their code where it just returns nothing instead of a result?

Getting frustrated...Thanks so much for your help!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to