A deep culture map of Ireland that fetches Irish towns, cities, and villages, enriches them with cultural information using AI, and displays them on an interactive web map. It's cool.
This project combines geographic data from OpenStreetMap with AI-powered cultural enrichment to create an interactive map of Irish places. The three main components are:
- get_ireland_places.py - Fetches Irish populated places from Overpass API
- enrich_ireland_culture.py - Enriches place data with cultural information using OpenAI's API
- server.py - Flask web server that serves the data and hosts the interactive map
- Python 3.7+
- An OpenAI API key
cd /Users/johnathan/WHERES-DA-CRAICpython3 -m venv venv
source venv/bin/activate # On macOS/Linux
# or on Windows: venv\Scripts\activatepip install flask flask-cors requests tqdm openai python-dotenvFetch Irish towns, cities, villages from OpenStreetMap:
python3 get_ireland_places.pyThis creates places_ireland.csv with Irish place names, coordinates, and types. It uses the Overpass API, so it may take a few minutes.
Enrich the places with cultural information using OpenAI:
# Set your OpenAI API key first
export OPENAI_API_KEY="your-api-key-here"
python3 enrich_ireland_culture.pyThis script:
- Reads from
places_ireland.csv - Queries OpenAI for cultural details about each place
- Saves progress in
enrichment_checkpoint.json(can resume if interrupted) - Creates the enriched dataset for the map
python3 server.pyThe server will start on http://localhost:5001
Open your browser and navigate to http://localhost:5001 to view the interactive map.
- server.py - Flask web server with
/(map UI) and/data(GeoJSON API) endpoints - index.html - Interactive Leaflet-based map UI
- get_ireland_places.py - Overpass API fetcher for Irish places
- enrich_ireland_culture.py - OpenAI enrichment script with checkpoint recovery
- places_ireland.csv - CSV file with fetched Irish places (generated)
- enrichment_checkpoint.json - Checkpoint file for enrichment progress (generated)
Create a .env file in the project root:
OPENAI_API_KEY=your-api-key-here
Or set it directly in your terminal:
export OPENAI_API_KEY="your-api-key-here"- ModuleNotFoundError: Make sure all dependencies are installed with
pip install -r requirements.txt - CSV not found: Run
get_ireland_places.pyfirst - OpenAI API errors: Verify your API key is correct and has sufficient credits
- Port 5001 already in use: Modify the port in
server.pyline withapp.run()
[Add license information if applicable]