Skip to content

find the nearest restaurants with sanitary inspection grade and details using geocoding service, source from NYC open data

Notifications You must be signed in to change notification settings

honghu215/NYCOpenData_FindNearestRestaurants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

NYC OpenData tool: Find nearest restaurants with inspection detail

find the nearest restaurants with sanitary inspection grade and details using geocoding service, source from NYC open data

This tool will show the user the nearest a number of restaurants (specified by user input) with inspection details based on user input address and search count.

The dataset the tool is using is DOHMH New York City Restaurant Inspection Results from NYC Open Data.
The tool is delpoyed on CrossCompute platform. Click here to run the program. example

How it works

  • Basically, it uses KD-Tree to build a 10-D tree (let's say search count it 10), and then find the shortest distance from the user's position. It calculates the distance in the form of nodes, which in this case is coordinates(latitude and longitude).

Steps:

  1. Get the dataset: NYC open data provides API for each dataset. Go to API docs to learn about how to retrieve this dataset via Socrata Open Data API.
  2. The dataset is over 380,000 recordes, including all restaurants in New York. It has no coordinate attribute, but building number, borough, street and zip code. I'm using geoclient API to get coordinates and save it as .csv file locally. Refer to ConvertCoordinate.py
  3. FindNearestRestaurants.py will read csv file, which includes coordinates attribute, and then build kd-tree to find shortest distance and ouput the nearest restaurants.

Bugs

  • Takes long time: The dataset is huge, over 380,000 records. Although it can be filtered to 27,000, it takes over half an hour to resolve this number of addresses to coordinates.

About

find the nearest restaurants with sanitary inspection grade and details using geocoding service, source from NYC open data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages