This project analyzes the proximity and connectivity of a given location based on nearby amenities and infrastructure. Using OpenStreetMap (OSM) data, it calculates features like distances to Points of Interest (POIs) and predicts if the location is "perfectly connected with amenities" or "poorly connected."
OSM Integration: Extracts nodes, edges, and POIs from OSM for a specified location.
Feature Extraction: Calculates distances to amenities like schools, restaurants, and places of worship.
Machine Learning: Uses Random Forest Classifier to classify locations as well-connected or poorly connected.
Flask API: Provides an endpoint to input a location and get connectivity predictions.
project/
├── data/
│ ├── osm_nodes.csv # Nodes data from OSM
│ ├── osm_edges.csv # Edges data from OSM
│ └── pois.geojson # Points of Interest data
├── src/
│ ├── flask_api.py # Flask server code
│ ├── data_processing.py # Handles OSM data loading and processing
│ ├── feature_extraction.py # Extracts proximity and amenity-related features
│ ├── model.py # Trains and predicts using Random Forest Classifier model
│ └── requirements.txt # Python dependencies
└── README.md # Project documentation
Python 3.9+
Flask
scikit-learn
geopandas
osmnx
geopy
Install dependencies using:
pip install -r requirements.txt
-
OSM Data: Downloads nodes, edges, and POIs for the specified location using OSM APIs.
-
Feature Extraction: Calculates distances from a given location to nearby amenities.
-
Model Training: Trains a Random Forest Classifier model on labeled examples to classify locations.
-
API Prediction: Takes a location as input via the Flask API and returns whether it is "perfectly connected with amenities" or not.
-
Place the dataset files (
osm_nodes.csv, osm_edges.csv, and pois.geojson
) in the data/ folder. -
Start the Flask server:
python src/flask_api.py
-
Use the
/predict
endpoint to get predictions. Example:
curl -X POST http://127.0.0.1:5000/predict -H "Content-Type: application/json" -d '{"location": [9.925, 78.119]}'
- First choose "Use My Current Location" and then choose any area from madurai and explore it.
- Moulesh G S
- Janarthanan C
- Vivek Ram Prakash
- Arun Kumar J E
- Vigneshwarlal