A comprehensive web application for finding the best drone flying locations in Malaysia. The system analyzes maps, terrain data, and safety factors to recommend optimal spots for drone operations.
- Interactive Map Interface: Visualize drone spots on an interactive map with multiple view modes (Standard, Satellite, Facebook HQ)
- Smart Search: Search by address or coordinates with customizable radius
- Safety Scoring: Each spot is rated based on safety factors, accessibility, and nearby no-fly zones
- Real-time Data: Integrates with OpenStreetMap, Nominatim, and OSRM for accurate geocoding and routing
- RESTful API: FastAPI backend with comprehensive endpoints for programmatic access
- Multiple View Modes: Switch between standard map, satellite view, and Facebook HQ view
- Car Accessibility: Filter spots by car accessibility
- Distance Calculation: Accurate road distance calculations using OSRM
Watch the complete demonstration of the Facebook HQ view mode:
MP4 (Recommended): search_demo_facebook_hq.mp4
WebM: search_demo_facebook_hq.webm
Standard Facebook view demonstration:
MP4 (Recommended): search_demo_facebook.mp4
WebM: search_demo_facebook.webm
Satellite view mode demonstration:
MP4 (Recommended): search_demo_satellite.mp4
WebM: search_demo_satellite.webm
Basic search functionality demonstration:
MP4 (Recommended): search_demo.mp4
WebM: search_demo.webm
Note: To convert WebM files to MP4, see CONVERT_TO_MP4.md
- Python 3.12+
- Docker and Docker Compose (for optional services)
- Node.js (optional, for development)
-
Clone the repository
git clone https://github.com/fisapool/Drone-Spots-Map---Malaysia.git cd Drone-Spots-Map---Malaysia -
Install Python dependencies
pip install -r requirements.txt pip install -r requirements_api.txt
-
Set up environment variables (optional) Create a
.envfile:OPENWEATHER_API_KEY=your_key_here NOMINATIM_URL=localhost:8080 OSRM_URL=localhost:5000
-
Start the API service
# For Linux/Ubuntu ./start_api_ubuntu.sh # Or run directly python drone_spots_api.py
-
Access the map Open your browser and navigate to:
http://localhost:8001/map
- Open the map at
http://localhost:8001/map - Use the search box to enter an address (e.g., "Kuala Lumpur")
- Adjust the search radius if needed
- Click "Search" to find drone spots
- Click on markers to see detailed information
- Use view controls to switch between map types
curl "http://localhost:8001/search?address=Kuala%20Lumpur&radius_km=10"curl "http://localhost:8001/search?latitude=3.1526&longitude=101.7022&radius_km=10"curl "http://localhost:8001/spot?latitude=3.1526&longitude=101.7022"# View spots on map automatically
python view_spots_on_map.py "Kuala Lumpur"
# Search with custom radius
python view_spots_on_map.py "Kuala Lumpur" --radius 20
# Load from JSON file
python view_spots_on_map.py --file response.json- FastAPI: Modern, fast web framework for building APIs
- Geopy: Geocoding and distance calculations
- Nominatim: OpenStreetMap geocoding service
- OSRM: Open Source Routing Machine for road distances
- Leaflet.js: Interactive map library
- Vanilla JavaScript: No framework dependencies
- Responsive Design: Works on desktop and mobile
- Nominatim: Self-hosted geocoding (via Docker)
- OSRM: Self-hosted routing (via Docker)
- API Quick Reference
- API Service Setup
- How to Use Map
- Nominatim Setup
- OSRM Setup
- Network Access
- Troubleshooting
The API can be configured via environment variables or .env file:
# OpenWeatherMap API key (optional)
OPENWEATHER_API_KEY=your_key
# Self-hosted Nominatim (optional)
NOMINATIM_URL=localhost:8080
USE_SELF_HOSTED_NOMINATIM=true
# Self-hosted OSRM (optional)
OSRM_URL=localhost:5000
USE_OSRM=true
# Performance settings
WORKERS=8
MAX_KEEPALIVE_CONNECTIONS=100
MAX_CONNECTIONS=200
TIMEOUT=30.0docker-compose -f docker-compose.nominatim.yml up -ddocker-compose -f docker-compose.osrm.yml up -d# Test the API
curl http://localhost:8001/
# Test search endpoint
curl "http://localhost:8001/search?address=Kuala%20Lumpur"
# Run map tests
./run_map_tests.shGET /- API health checkGET /search- Search for drone spots by address or coordinatesGET /spot- Get detailed information about a specific spotGET /map- Interactive map interfaceGET /docs- Interactive API documentation (Swagger UI)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- OpenStreetMap for map data
- Nominatim for geocoding
- OSRM for routing
- Leaflet.js for map visualization
- FastAPI for the backend framework
For questions or support, please open an issue on GitHub.
Note: Make sure to comply with local drone regulations and obtain necessary permissions before flying in any location.
