Loading repository data…
Loading repository data…
aymenhmaidiwastaken / repository
AI-powered photo geolocation tool — upload any photo and AI analyzes visual clues to pinpoint the exact location on an interactive map. Built with Node.js, Gemini Vision AI, and Leaflet.js.
Upload any photo. AI pinpoints the exact location on the map.
GeoSnap uses advanced vision AI to analyze visual clues in photographs — street signs, architecture, vegetation, text, language scripts, road markings, and more — to determine the precise geographic location where a photo was taken.
Features | Demo | Quick Start | How It Works | Tech Stack
| Upload & World View | Location Detected | AI Analysis & Clues |
|---|---|---|
# Clone the repository
git clone https://github.com/aymenhmaidiwastaken/geosnap.git
cd geosnap
# Install dependencies
npm install
# Configure your API key
cp .env.example .env
# Edit .env and add your Gemini API key (free at https://aistudio.google.com/apikey)
# Start the server
npm start
Open http://localhost:3000 and upload a photo.
If you prefer local AI with no API keys:
# Install Ollama from https://ollama.com
ollama pull llama3.2-vision
# Remove GEMINI_API_KEY from .env (or leave it empty)
# GeoSnap will automatically fall back to Ollama
npm start
Note: Local models are less accurate than Gemini for geolocation tasks. Gemini's free tier (1,500 requests/day) is recommended for best results.
Photo Upload ──> Image Optimization ──> AI Vision Analysis ──> JSON Parsing ──> Map Rendering
(Sharp: resize, (Gemini/Ollama: (Robust repair (Leaflet: flyTo,
JPEG compress) 15+ clue types) + fallback) pulsing marker,
confidence circle)
| Layer | Technology |
|---|---|
| Frontend | Vanilla JS, Leaflet.js, CSS3 Animations |
| Backend | Node.js, Express |
| AI | Google Gemini 2.5 Flash / Ollama (LLaMA 3.2 Vision) |
| Image Processing | Sharp |
| Maps | CartoDB Dark Matter, Esri Satellite, CartoDB Voyager |
geosnap/
├── server.js # Express API server with dual AI provider support
├── public/
│ ├── index.html # Single-page application shell
│ ├── styles.css # Dark theme, animations, responsive layout
│ └── app.js # Map rendering, upload handling, results display
├── screenshots/ # Demo screenshots
├── .env.example # Environment template
└── package.json
POST /api/analyzeUpload an image for geolocation analysis.
Request: multipart/form-data with an image field
Response:
{
"latitude": 36.8711,
"longitude": 10.2344,
"confidence": "high",
"confidencePercent": 88,
"locationName": "Rue Hedi Zarrouk",
"city": "Sidi Bou Said",
"country": "Tunisia",
"countryCode": "TN",
"analysis": {
"clues": [
{
"type": "architecture",
"observation": "White-washed buildings with blue trim",
"significance": "Characteristic of Sidi Bou Said, Tunisia"
}
],
"reasoning": "Mediterranean architecture with distinctive blue-and-white color scheme..."
}
}
MIT
Built by @aymenhmaidiwastaken