Welcome to iCropMap! This project provides an interactive map to visualize crop data across different states and counties in the USA.
- Interactive map displaying crop data by state and county
- Choropleth layers to visualize crop data intensity
- Custom popups with detailed information
- Scoreboard displaying crop data statistics
- Python 3.x
- Virtual environment (venv)
-
Clone the repository:
git clone https://github.com/Seth-Keenan/iCropMap cd iCropMap -
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
-
On macOS and Linux:
source venv/bin/activate -
On Windows:
.\venv\Scripts\activate
-
-
Install the required packages:
pip install -r requirements.txt
-
API Key:
Retrieve an API key from the USDA Crop Statistic API, and create a config.py file and input "API_KEY=[your api key here]"
-
Start the FastAPI server:
fastapi run
-
Open your web browser and navigate to:
http://127.0.0.1:8000
-
Home Page:
GET /Displays the main page with the interactive map.
-
Map Page:
GET /map?crop=<crop>&year=<year>Displays the map with crop data for the specified crop and year.
-
County Map Page:
GET /county_mapDisplays the county-level map.
-
Contact Page:
GET /contactDisplays the contact page.
- main.py: FastAPI application setup and endpoints.
- map.py: Map generation and data processing.
- data.py: Data fetching and processing.
- static/: Static files (CSS, JS, images).
- templates/: HTML templates.
For any questions or inquiries, please contact [email protected].