Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manimaul/SwiftVectorTiles
A Swift Mapbox vector tile encoder
https://github.com/manimaul/SwiftVectorTiles
Last synced: 25 days ago
JSON representation
A Swift Mapbox vector tile encoder
- Host: GitHub
- URL: https://github.com/manimaul/SwiftVectorTiles
- Owner: manimaul
- License: other
- Created: 2016-12-28T21:23:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-17T15:15:23.000Z (almost 4 years ago)
- Last Synced: 2024-08-03T19:08:45.009Z (4 months ago)
- Language: Swift
- Size: 1.99 MB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-vector-tiles - SwiftVectorTiles - A Swift encoder for vector tiles according to the Mapbox vector tile spec. (Parsers & Generators)
README
# SwiftVectorTiles
A Swift encoder for vector tiles according to the [Mapbox vector tile spec](https://github.com/mapbox/vector-tile-spec)### Acknowledgements
* [Java Vector Tiles](https://github.com/ElectronicChartCentre/java-vector-tile)
* [GEOS & JTS](https://trac.osgeo.org/geos/)
* [Mapbox Vector Tile Spec](https://github.com/mapbox/vector-tile-spec)
* [Swift Google Protocol Buffers](http://protobuf.io/#swift)### Status
Beta - expect a few bugs### Cocoapods
```ruby
use_frameworks!target 'YourTarget' do
pod 'SwiftVectorTiles', :git => 'https://github.com/manimaul/SwiftVectorTiles.git'
end
```### Example
```swift
// initialize an encoder
let encoder = VectorTileEncoder()// create some attributes
var atts = [String: Attribute]()
atts["some_key"] = Attribute.attString("some_value")// polygon geometry "well known text"
let wkt = "POLYGON ((0 0, 4096 0, 4096 4096, 0 4096, 0 0))"// add the geometry and it's attributes as a "feature"
encoder.addFeature(layerName: "land", attributes: atts, geometry: wkt)// encode to Mapbox vector tile
let data :Data = encoder.encode()```
### Screenshots
| Encoded [Natural Earth Data](http://www.naturalearthdata.com/) geometries| |
| --------------------------------------------- | ---------------------------------------- |
|![](screenshots/shot1.png)|![](screenshots/shot2.png)|