There are several solutions for your purpose, such as CartoDB Integration , Bing Location API , geography , geocoder . strong>, API SmartyStreets and others.
Let's look at this using CartoDB :
Create a file with the coordinates of longitude and latitude in New York.
Use the Zillow New York neighborhood geometry file
Load the files in Cartodb and geoencode coordinates of longitude and latitude as a geometry object in your file of coordinates of longitude and latitude.
Run the following SQL query from a file:
SELECT a.*, b.neighborhood FROM inputFileName as a, nyc_pediacities_neighborhoods_v3_polygon as b WHERE ST_Within(a.the_geom,b.the_geom)
We create two inputFile
as a
and a shapefile
as b
, and then map the geometries to each other with a WHERE clause.
We are creating a new column with rows denoting the New York neighborhood for the longitude and latitude of the same row.
Just export the file in the desired format and enjoy the information.
You can easily automate the process using one of their integrations. This will act as the perfect API. See this
The python geopy
also noteworthy. Check this
You can achieve the same result using the Bing Location API. See API
Another possible solution is to create your own API from open data.
Check out geocoder and SmartyStreets