views:

240

answers:

2

Is there any way to effectively/accurately pull out a neighborhood within a city based on a passed in address, zip, city, state to the Google Geocoder?

Whenever I try to do it via HTTP (ideal solution) It returns the following info

<kml>
−
<Response>
<name>anthonys cookies san francisco California</name>
−
<Status>
<code>200</code>
<request>geocode</request>
</Status>
−
<Placemark id="p1">
<address>San Francisco, CA, USA</address>
−
<AddressDetails Accuracy="4">
−
<Country>
<CountryNameCode>US</CountryNameCode>
<CountryName>USA</CountryName>
−
<AdministrativeArea>
<AdministrativeAreaName>CA</AdministrativeAreaName>
−
<SubAdministrativeArea>
<SubAdministrativeAreaName>San Francisco</SubAdministrativeAreaName>
−
<Locality>
<LocalityName>San Francisco</LocalityName>
</Locality>
</SubAdministrativeArea>
</AdministrativeArea>
</Country>
</AddressDetails>
−
<ExtendedData>
<LatLonBox north="37.8454521" south="37.7043396" east="-122.2913561" west="-122.5474749"/>
</ExtendedData>
−
<Point>
<coordinates>-122.4194155,37.7749295,0</coordinates>
</Point>
</Placemark>
</Response>
</kml>

If you notice, the "locality name" still says San Francisco?

At this point I am open to making use of the Javascript API/call as opposed to the HTTP call, it just seemed like overkill (and more of a headache) for what I am trying to do.

Ideally, I need this to work in San Francisco for now, but it would be nice if I could get it to work for all of the major U.S. Cities.

A: 

Use the free service from http://www.maxmind.com/app/ip-location

You're never going to get it 100% accurate, but it should give you a head start.

There's also geotargeting in HTML5, but not all browsers support it yet and I'm unsure how to extract the user's geo location.

Noodles
Great service, and advice, but it seems like this service speaks more to geolocating visitors to your site based on their IP. I am specifically looking to pull neighborhood data from some API (Google in this case), based on an address passed to the API from a form. i.e. in the above example the neighborhood should show as "The mission district" or "Mission".
dnyce
Sorry, I misunderstood what you meant. I don't think Google Maps supports areas like what you're after.
Noodles
+1  A: 

As far as I know, you can't get Neighborhood data through the google maps API. You can try another web service like Urban Mapping's Neighborhood API: http://developer.urbanmapping.com/demo/ or Maponics (http://www.maponics.com/Neighborhood_Boundaries/neighborhood_boundaries.html). Urban Mapping's API contains methods for getting neighborhood by lat long and also various address elements.

Sweet Lew
I'll forward this info on to the developer that replaced me on this particular project.
dnyce