mapbox / vector-tile-cs

Parses vector tiles with C#.
BSD 3-Clause "New" or "Revised" License
57 stars 37 forks source link

Add parameter if and how tile data should be clipped #22

Closed wilhelmberg closed 7 years ago

wilhelmberg commented 7 years ago

Almost all tiles contain data outside the actual tile extent (needed for labeling, joining features crossing tile boundaries, ...).

E.g. overzoomed z18 tile (red: extent of requested tile, gray: data in that tile):

image

Some clients may need the data to be cut exactly at the boundary or at a specified buffer width.

Pseudo-code:

public IGeometry GetGeom(int? buffer) {
  if(null == buffer) { return geom.AsIs; }
  return geom.Clip(buffer.Value);
}
wilhelmberg commented 7 years ago

Added in https://github.com/mapbox/vector-tile-cs/pull/21