com.pb.lisdk.vectortile

## Class VectorTileWriterBuilder

- java.lang.Object
- - com.pb.lisdk.vectortile.VectorTileWriterBuilder

    public class VectorTileWriterBuilder
    extends Object

A builder to create `IVectorTileWriter` instances. A new builder for MVT tile writers can be created with the static `VectorTileWriterBuilder.newMVTBuilder()` method. Various writer semantics, like clipping or coordinate transformation, can then be set, before calling `VectorTileWriterBuilder.build()` to create a new vector tile writer.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`IVectorTileWriter` `build()` Creates a new vector tile writer with the semantics defined by any previous method calls on this builder instance.
`static VectorTileWriterBuilder` `newMVTBuilder()` Creates a builder for an MVT vector tile writer.
`VectorTileWriterBuilder` `withClipping(double bufferRatio)` Enables clipping.
`VectorTileWriterBuilder` `withRemovalOfDegenerateGeometries()` Enables removal of any non-point geometries that collapse into a single point due to operations like coordinate transformation or clipping.
`VectorTileWriterBuilder` `withRemovalOfDuplicatePoints()` Enables removal of duplicate points.
`VectorTileWriterBuilder` `withTransformation(CoordSys targetCoordSys, int extent)` Enables coordinate transformation.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### newMVTBuilder

    public static VectorTileWriterBuilder newMVTBuilder()

Creates a builder for an MVT vector tile writer.

#### withClipping

    public VectorTileWriterBuilder withClipping(double bufferRatio)

Enables clipping. Features added to the vector tile writer created with this builder will be clipped so that any parts that are outside the tile bounds (plus the specified buffer) will be removed. The `bufferRatio` defines the size of the buffer in relation to the size of the tile bounds. A value of 0 results in no buffer. A value of 1 results in a buffer equal to the width (horizontal) or height (vertical) of the tile bounds.

Parameters:
  `bufferRatio` - a fraction value, greater than or equal to 0, defining the size of the clip buffer.
Returns:
  this builder instance

#### withRemovalOfDuplicatePoints

    public VectorTileWriterBuilder withRemovalOfDuplicatePoints()

Enables removal of duplicate points. Features added to the vector tile writer created with this builder will have any duplicate consecutive points removed.

Returns:
  this builder instance

#### withRemovalOfDegenerateGeometries

    public VectorTileWriterBuilder withRemovalOfDegenerateGeometries()

Enables removal of any non-point geometries that collapse into a single point due to operations like coordinate transformation or clipping. When passing such a geometry to the `addFeature()` method of the resulting vector tile writer, the geometry will be dropped and the call returns silently.

Returns:
  this builder instance

#### withTransformation

    public VectorTileWriterBuilder withTransformation(CoordSys targetCoordSys,
                                                      int extent)

Enables coordinate transformation. This affects the tile bounds passed to `startTile()` and any features added with `addFeature`. The transformation consists of two parts. First, if necessary, features will be transformed to the given target coordinate system. If no target coordinate system is specified, EPSG:3857 - Web Mercator will be used. Second, coordinates will undergo a linear transformation to the screen coordinate system for the tile the feature has been added. The screen coordinates are represented in a cartesian coordinate system with the origin in the top left corner and a flipped vertical axis. The extent of the coordinate system is specified with the `extent` parameter. All tiles created with this vector tile writer share the same extent.

Parameters:
  `targetCoordSys` - the coordinate system to transform geometries, before transforming coordinates values to screen coordinates
  `extent` - the size of the screen coordinate system
Returns:
  this builder instance

#### build

    public IVectorTileWriter build()

Creates a new vector tile writer with the semantics defined by any previous method calls on this builder instance.