A free, open-source tool to convert map images (PNG, JPG) and SVG files into GeoJSON format, using AI and computer vision. Born as an alternative to expensive databases like Geochron (500€), enabling accessible geospatial data creation.
- Highlights
- Background
- Quick Start
- Usage
- Features
- Algorithm Overview
- Outputs
- Limitations & Roadmap
- Contributing
- Documentation
- References
- 🆓 Free & Open-Source: No costs, ideal for students and researchers.
- 🎨 AI-Powered: Uses segmentation and contour detection for automatic polygon extraction.
- 🗺️ Multiple Inputs: Supports images (PNG, JPG) and SVG files.
- 📦 GeoJSON Export: Outputs standard GeoJSON FeatureCollection.
- 🔬 Prototype: Extensible for research and education.
This project was created by students to provide free access to geospatial data. Commercial services charge money for databases, making them inaccessible for educational projects. Our tool leverages open-source libraries (OpenCV, GDAL, PyTorch) to convert simple map images into usable GeoJSON files.
Transform map images into GeoJSON automatically:
| Input Map | Output (Detected Regions) |
|---|---|
![]() |
![]() |
The tool extracts colored regions, identifies boundaries, and generates GeoJSON files ready for use in GIS applications.
- Python 3.8+
- Libraries: OpenCV, NumPy, Shapely, PyTorch (optional for AI)
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt# Image to GeoJSON with AI
python "src/test con ai/image_to_geojson_auto.py"
# SVG to GeoJSON
python "src/test svg to geojson/Svg_to_Geojson_Converter.py"- Prepare your map image or SVG file.
- Run the appropriate script.
- Choose calibration (Italy preset or manual).
- Outputs: GeoJSON file and debug images.
For detailed pipeline, see src/test con ai/pipeline.md.
- Image Conversion: Extract polygons from map images using K-Means segmentation and contour detection.
- SVG Support: Convert SVG paths to GeoJSON.
- Georeferencing: Optional pixel-to-lat/lon calibration.
- AI Integration: Prototype with deep learning for better segmentation.
- Debug Visuals: Segmented and region overlay images.
- Preprocessing: Image segmentation with K-Means or AI models.
- Contour Detection: Use OpenCV to find shapes.
- Filtering: Remove noise, water, etc., based on heuristics.
- Georeferencing: Map pixels to coordinates.
- Export: Generate GeoJSON with properties (id, color, area).
See src/test con ai/pipeline.md for full architecture.
- GeoJSON File: FeatureCollection with polygons.
- Debug Images:
_segmented.png(clusters),_regions.png(polygons). - Visualize at https://geojson.io.
- Works best on simple maps; complex ones may need manual tweaks.
- Linear calibration; advanced georeferencing planned.
- Future: Web interface, batch processing, better AI models.
See docs/feasibility/StudioDiFattibilità.md for detailed feasibility study.
We welcome contributions! Open issues or PRs. Focus areas:
- Improve AI segmentation.
- Add more input formats.
- Enhance georeferencing.
For requirements gathering, see docs/feasibility/requirements/.
- Feasibility Study:
docs/feasibility/StudioDiFattibilità.md - Requirements:
docs/feasibility/requirements/Analisi_Concorrenza.md,Suggerimenti_Spontanei.md - Pipeline:
src/test con ai/pipeline.md - Contributing:
CONTRIBUTING.md - Examples:
examples/ - Tests:
tests/ - Changelog:
CHANGELOG.md
- Scripts:
src/test con ai/,src/test svg to geojson/ - Inspired by open-source GIS tools like QGIS and GDAL.
- For feedback, open GitHub Discussions.

