Skip to content

Repository files navigation

Nearest-State-finder

Designed this project in Boston University in Sep 2023-Dec2023

  1. 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.
  2. 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.

Nearest-state-country-finder

EC504 class project Nearest state/country finder

Getting Started

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 and output

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

Features

Load Reference Points

loads reference points (including latitude, longitude, state, and county information)
into the KD-tree from a file or other source.

Query the nearest K reference points

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.

Majority Vote for States and Counties

For a given reference point, determine the state
and county by calculating the majority vote for the 5 nearest points.

g++ -std=c++17 -o load load.cpp

this project code requirte c++ version 17

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages