MapTool is a Flutter application for downloading and processing OpenStreetMap vector tiles from Geofabrik. This tool specializes in fetching Shortbread MBTiles and optimizing them by removing unnecessary layers for specific use cases.
Part of the Librescoot open-source platform.
- Browse Geofabrik's complete region hierarchy
- Automatic detection of available Shortbread MBTiles
- Download progress tracking with visual feedback
- Process MBTiles by removing selected vector tile layers
- Cross-platform support (iOS, Android, Desktop)
- Hierarchical navigation through regions and subregions
- Temporary file management and cleanup
flutter- Cross-platform UI frameworkhttp- HTTP requests for downloading fileshtml- HTML parsing for Geofabrik pagessqflite- SQLite database for MBTiles manipulationarchive- GZIP compression/decompressionprotobuf- Vector tile format parsingfile_picker- Native file save dialogspath_provider- Platform-specific storage pathsfixnum- Fixed-width integer operations
The application is structured around three main components:
- Region Navigation: Browse and navigate through Geofabrik's region hierarchy
- Download Service: Manages file downloads with progress tracking
- MBTiles Processor: Removes unnecessary layers from vector tiles
- GeofabrikService: Scrapes and parses Geofabrik download pages
- DownloadService: Handles file downloads with progress callbacks
- MBTilesService: Processes vector tiles using protobuf definitions
- Region Models: Data structures for regions and vector tiles
- UI Screens: Home screen for regions, detail screen for downloads
The following layers are automatically removed during processing:
- addresses
- aerialways
- boundaries
- boundary_labels
- bridges
- buildings
- dam_lines
- ferries
- ocean
- pier_lines
- pier_polygons
- place_labels
- pois
- public_transport
- street_polygons
- street_labels_points
- streets_polygons_labels
- sites
- water_lines
- water_lines_labels
- water_polygons_labels
- Flutter SDK 3.3 or higher
- Dart SDK
- Platform-specific development tools (Xcode for iOS, Android Studio for Android)
flutter pub get
flutter build [platform]Where [platform] can be:
apkorappbundlefor Androidiosfor iOSwindows,macos, orlinuxfor desktop
flutter run- Launch the application
- Browse available regions from the main screen
- Navigate through subregions by tapping on entries
- When a region has Shortbread tiles available, a download button appears
- Tap "Download & Process Shortbread Tiles" to begin
- Monitor download progress
- Choose a save location for the processed file
- The app automatically removes unnecessary layers and saves the optimized MBTiles
The application processes MBTiles files by:
- Decompressing GZIP-encoded vector tiles
- Parsing protobuf-encoded tile data
- Filtering out specified layers
- Re-encoding and compressing the modified tiles
- Saving the optimized MBTiles database
Contributions are welcome! Please feel free to submit a Pull Request.
This project is dual-licensed. The source code is available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The maintainers reserve the right to grant separate licenses for commercial distribution; please contact the maintainers to discuss commercial licensing.
