# java-vector-tile
**Repository Path**: gis_6/java-vector-tile
## Basic Information
- **Project Name**: java-vector-tile
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2024-08-08
- **Last Updated**: 2025-04-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## 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/releases
no.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)