Getting locations in neighbourhood, for a given latitude and longitude. - geolocation

Given a latitude and longitude, how do i get the localitites around, saying that i mean, say i am in can i get a dataset having names of major locations in neighbourhood, or some tourist spot near it?
say i am in paris and have the lat and long { lat : 48.8565, lng : 2.3509 }, // paris
could get some json/xml with stuffs like {"Eiffel Tower", "Arsenal"} etc.

I'm not up on non-USA sources of geo data, but the USGS (United States Geological Survey) publishes an official gazetter of place names including latitude and longitude of the primary point (for a city, typically city hall or similar) of that place.
http://geonames.usgs.gov/domestic/download_data.htm
I successfully used this data in the past by loading it into PostgreSQL and using it's geospatial query capability.

Related

What downloadable data sources exist for getting country from latitude, longitude, and date?

I have seen countless questions asking about converting latitude / longitude coordinates into country, state, town, etc., but I found no question which includes a time component. I have tried many searches, but only seem to be able to get isolated data sources by year or real-time APIs, not any open source data with a time component.
As an example using United States recognition, the coordinates (42.635832, 20.946381) would show Kosovo today, but in 2005 would show Serbia, and would at some point further in the past show Yugoslavia.
The question is, what data source can be used to retrieve country from latitude, longitude, and date? The ideal granularity would be day, ideal source of authority would be US recognition. The ideal data format would be some sort of structured shape data with start and end dates for validity.

Geolocation: How to derive the Country using an address/city/place?

I have a .csv file with Twitter profiles including information such as username, name, description etc. One column is geolocation. In this text the user may have a country (i.e., UK), a city or town (i.e., Cambridge), an actual address (5 Tyrian Place, WR5 TY1), a state (i.e, California, CA) or something silly (i.e., West of Hell).
Is there an API/library/automatic way of taking this information and deriving the country? For example, if the location is Cambridge the output should be UK, if the address is in the UK, the output should be UK, etc.
Google has a reverse geocoding service which you can access through their Maps API:
https://developers.google.com/maps/documentation/geocoding/start
They let you make 2500 free requests per day. One nice feature is it will give you correct latitude, longitude, state, country, etc for things like "Golden Gate Bridge" and "The Big Apple." Twitter users enter all sorts of (sarcastic) phrases for their location -- like "West of Hell," "Mars," etc -- and Google will reverse geocode that as well. Though, that may not be very useful.
As another level of checking, you can compare the user's timezone ("utc_offset"), if it is present, to the place that Google returns. It's a bit involved and requires that you compare the timezone's latitude boundaries to the latitude and longitude in Google's response.

lat lng to neighborhood info

Is there a dynamic hierarchical data source out there that I can use to identify a lat lng point into a neighborhood?
For instance, if I was in Manhattan, it would recognize that I'm in Chinatown, Manhattan, New York City in that order. And if I was in a less densely populated area it would just put me into a neighborhood that would span a larger area. It can be a bit fuzzy in this concept.
Ultimately I want to group people into their nearest neighobrhood given evenly sized neighborhood population.
I know that zip codes can roll up into a metro area, but I wonder if there is something that's more granular or more dynamic.
Google's geocoding API can give a variety of levels of detail about a location. It varies by region, country, and even at state/local levels but you should be able to get close to what you're looking for.

Get a list of cities around a city with a given radius with google places api

I'm using google places api for autocomplete on a RoR project.
I want to get a list of cities around the typed city with a given radius.
For instance:
I type "Paris, France" in the input. I want to have a list (JSON or whatever) which contains all the cities around the city with a given radius (maybe 10 miles or more, it'll be a constant in the project).
How can I do that?
Thanks!
-EDIT-
I've end up with this:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.534031,2.632121999999981&language=fr&types=locality&sensor=false&rankby=distance&key=YOUR_KEY_HERE
The lat and lng must point to a town near Paris called "Le Mee sur Seine" (https://maps.google.fr/maps?hl=fr&q=48.534031,2.632121999999981).
I want to list the towns surrouding this city ordered by distance but I have "ZERO_RESULTS" as a result...
The type you're tying to filter on, "locality" is specifically listed as not supported. That is, Google will not let you specifically search for locality or a number of other political geo types. See the full list of unsupported types here: https://developers.google.com/places/documentation/supported_types#table2

Are geolocation apps based on latitude and longitude data?

Are most web and smartphone applications that show you how far other users are from you essentially based on a user's latitude and longitude? That is, do these apps basically derive a user's latitude and longitude from their country and postal code and then use an algorithm to create a sorted list of all users who are near them, closest first? I believe the answer is "yes" but I want to make sure before I build this feature into my Django application.
For those countries that don't use postal codes, I would imagine the latitude and longitude are derived from the city/region/country tuple they reside in.
Yes, they map IP to lat/long, and lat/long to city, and city to country, unless they have access to a GPS device/sensor for the exact position (+/- 1m).
The thing is, if you have an ip, you can convert that into a number (biginteger)
74.88.21.55 ==> (a.b.c.d) ==> d * 255^0 + c * 255^1 + b * 255^2 +a * 255^3 = x
then you can query a database.
All you need is a lookup-table:
T_Lookup
IP_Range_Start IP_Range_End Latitute Longitue
Then you can query like this:
SELECT Latitude, Longitude FROM T_Lookup
WHERE x BETWEEN IP_Range_Start AND IP_Range_End
Then you can calculate the distance between the two points using the haversine formula.
You can grab C code here:
http://aimbots.net/tutorials/7680-getting-country-ip-address.html
And an IP to country csv you find here:
http://ip-to-country.webhosting.info/node/view/6
Apps that display the locations of users relative to other users generally gather their data from either GPS data or IP address location data.
This Wiki article provides a nice explanation of geolocation.
They use the Galactic Coordinate system, which does in fact use longitude, l, and latitude, b.
http://en.wikipedia.org/wiki/Galactic_coordinate_system

Resources