Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ElectronicChartCentre/java-vector-tile
A java encoder and decoder for vector tiles according to Mapbox vector tile spec
https://github.com/ElectronicChartCentre/java-vector-tile
Last synced: 3 months ago
JSON representation
A java encoder and decoder for vector tiles according to Mapbox vector tile spec
- Host: GitHub
- URL: https://github.com/ElectronicChartCentre/java-vector-tile
- Owner: ElectronicChartCentre
- License: apache-2.0
- Created: 2014-05-28T06:30:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-06-13T11:54:52.000Z (5 months ago)
- Last Synced: 2024-06-13T14:33:12.184Z (5 months ago)
- Language: Java
- Homepage:
- Size: 645 KB
- Stars: 177
- Watchers: 18
- Forks: 71
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vector-tiles - java-vector-tile - A java encoder and decoder for vector tiles. (Parsers & Generators)
README
# Java Vector Tiles
A java encoder and decoder for vector tiles according to
[Mapbox vector tile spec](https://github.com/mapbox/vector-tile-spec)## Encode a vector tile
```java
VectorTileEncoder encoder = new VectorTileEncoder();// Add one or more features with a layer name, a Map with attributes and a JTS Geometry.
// The Geometry uses (0,0) in upper left and (256,256) in lower right.
encoder.addFeature("road", attributes, geometry);// Finally, get the byte array
byte[] encoded = encoder.encode();
```or, specifying the feature id:
```java
VectorTileEncoder encoder = new VectorTileEncoder();
encoder.addFeature("road", attributes, geometry, id);
byte[] encoded = encoder.encode();
```## Maven
```
ECC
https://maven.ecc.no/releasesno.ecc.vectortile
java-vector-tile
1.3.23```
## Generate VectorTile.java
`VectorTile.java` is generated from `src/main/porobuf/vector_tile.proto` using the `protoc-jar-maven-plugin` plugin.
Make sure to include the folder `target/generated-sources` in your class path.## License
[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
## Credits
Mapbox for their [vector tile spec](https://github.com/mapbox/vector-tile-spec),
Google for their [Protocol Buffers](https://code.google.com/p/protobuf/) and
Dr JTS and LocationTech for [JTS](https://github.com/locationtech/jts)