Designed this project in Boston University in Sep 2023-Dec2023
- Designed and implemented a C++ application, which takes the latitude and longitude as input and returns the nearest state for this location information as result.
- Employed KD tree for state’s location information storage and retrieval; applied majority voting algorithm on calculating the nearest state from the given input location.
EC504 class project Nearest state/country finder
git clone
cd Nearest-state-country-finder
Run make to complie the code
Run make run will test the sample input for the code
or ./load xxxx.txt
source code is under src
Input txt to tesing the code is under input folder
stracture of input file should be:
latitude
longitude
k
All output will show in consle and write in txt file under output folder
loads reference points (including latitude, longitude, state, and county information)
into the KD-tree from a file or other source.
Allow the user to enter a coordinate (latitude and longitude)
and return the nearest K reference points, where K is a number between 1 and 10.
For a given reference point, determine the state
and county by calculating the majority vote for the 5 nearest points.
this project code requirte c++ version 17