Added initializers for the new MapTile struct
Mapnik vector tiles (MVT) reader/writer for Swift.
dependencies: [ .package(url: "https://github.com/Outdooractive/mvt-tools", from: "0.4.0"), ], targets: [ .target(name: "MyTarget", dependencies: [ .product(name: "MVTTools", package: "mvt-tools"), ]), ]
import MVTTools // Load let mvtData = Data(contentsOf: URL(fileURLWithPath: "14_8716_8015.vector.mvt"))! let tile = VectorTile(data: mvtData, x: 8716, y: 8015, z: 14, indexed: .hilbert)! print(tile.isIndexed) print(tile.layerNames.sorted()) let tileAsGeoJsonData: Data? = tile.toGeoJson(prettyPrinted: true) ... let result = tile.query(at: Coordinate3D(latitude: 3.870163, longitude: 11.518585), tolerance: 100.0) ...
import MVTTools var tile = VectorTile(x: 8716, y: 8015, z: 14)! var feature = Feature(Point(Coordinate3D(latitude: 3.870163, longitude: 11.518585))) feature.properties = [ "test": 1, "test2": 5.567, "test3": [1, 2, 3], "test4": [ "sub1": 1, "sub2": 2 ] ] tile.setFeatures([feature], for: "test") // Also have a look at ``VectorTileExportOptions`` let tileData = tile.data() ...
Please create an issue or open a pull request with a fix
brew install protobuf swift-protobuf swiftlint
Documentation (!)
Tests
Decode V1 tiles
Locking (when updating/deleting features, indexing)
Query option: within/intersects
https://github.com/mapbox/vtcomposite
https://github.com/mapbox/geosimplify-js
https://github.com/mapbox/vt2geojson (command line tool?)
Vector tiles
Libraries
Sample data for testing:
Other code for inspiration:
MIT
Thomas Rasch, Outdooractive
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
MVTTools
Mapnik vector tiles (MVT) reader/writer for Swift.
Installation with Swift Package Manager
Features
Usage
Load
Write
Contributing
Please create an issue or open a pull request with a fix
Dependencies (for development)
TODOs and future improvements
Documentation (!)
Tests
Decode V1 tiles
Locking (when updating/deleting features, indexing)
Query option: within/intersects
https://github.com/mapbox/vtcomposite
https://github.com/mapbox/geosimplify-js
https://github.com/mapbox/vt2geojson (command line tool?)
Links
Vector tiles
Libraries
Sample data for testing:
Other code for inspiration:
License
MIT
Author
Thomas Rasch, Outdooractive