A Python-based GPS tracking application that provides real-time position tracking, data visualization, and interactive mapping capabilities. The application supports multiple location data sources and features a robust offline-capable mapping system.
-
Multiple Location Sources
- Serial GPS device support (NMEA protocol)
- IP-based geolocation
- Automatic GPS device detection
- Easy switching between data sources
-
Interactive Mapping
- Real-time position tracking
- Multiple map providers (OpenStreetMap, OpenTopoMap, CyclOSM)
- Local tile caching for offline use
- Scale bar and zoom controls
- Track visualization
- Draggable map interface
-
Data Collection
- Real-time GPS data display
- CSV data logging
- Track history recording
- Basic statistics (speed, altitude, etc.)
-
User Interface
- Clean, modern PyQt6-based interface
- Tabbed organization
- Status indicators
- Configuration options
- Optional: Serial GPS device (NMEA compatible)
- Computer running Windows, macOS, or Linux
- Python 3.11 or later
- Required Python packages (see Installation)
- Clone the repository:
git clone https://github.com/yourusername/gps-tracker.git
cd gps-tracker- Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install required packages:
pip install pyserial pynmea2 PyQt6 requests- Start the application:
python gps-tracker.py-
Select a location source from the dropdown menu:
- If using a GPS device, it should be automatically detected
- IP Geolocation is always available as a fallback
-
Main interface features:
- Show Map: Opens the interactive map window
- Start Logging: Begin recording GPS data to a CSV file
- Clear Track: Erases the current track history
- Refresh Devices: Scan for new GPS devices
-
Map controls:
- Click and drag to pan
- Mouse wheel or +/- buttons to zoom
- Drop-down to select different map styles
- Scale bar shows current map scale
The application is built with a modular design consisting of several key components:
- Abstract base class
LocationProviderdefines the interface SerialGPSProvider: Handles GPS device communicationIPLocationProvider: Provides IP-based locationLocationProviderManager: Manages provider lifecycle
TileManager: Handles map tile downloading and cachingMapWidget: Renders map and handles user interactionScaleBar: Provides dynamic scale information
- SQLite database for map tile caching
- CSV logging for track data
- Real-time data processing
gps-tracker/
├── gps-tracker.py # Main application file
├── map_cache/ # Cached map tiles
│ └── tile_cache.db
├── requirements.txt # Python dependencies
└── README.md
Main application window handling:
- User interface
- Data updates
- Provider management
- Logging control
Map tile management including:
- Multiple server support
- Rate limiting
- Caching system
- Error handling
Interactive map display with:
- Tile rendering
- Track visualization
- User input handling
- Dynamic updates
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch
- Follow the installation instructions above
- Make your changes
- Submit a pull request
- Follow PEP 8 style guide
- Add comments for complex functionality
- Update documentation as needed
- Add tests for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenStreetMap and contributors for map data
- PyQt6 team for the GUI framework
- Various map tile providers
-
No GPS devices detected
- Check USB connections
- Verify device permissions
- Try refreshing devices
-
Map tiles not loading
- Check internet connection
- Verify firewall settings
- Try different map providers
-
Serial port errors
- Check device permissions
- Verify correct port selection
- Ensure proper baud rate
Add the --debug flag when running for additional logging:
python gps-tracker.py --debugPlanned features for future releases:
- Multiple simultaneous tracks
- Elevation profiles
- Route planning
- Weather data integration
- Additional map sources
- Mobile device support
- Network GPS receiver support
- Advanced statistics and analysis
For support, please:
- Check the troubleshooting guide
- Search existing issues
- Create a new issue with:
- Detailed problem description
- Error messages
- System information
Built with AI assistance from Claude (Anthropic).