JtsOverlayEngine

class JtsOverlayEngine(gridSize: Double = PolygonOverlay.DEFAULT_GRID_SIZE) : OverlayEngine, InsetEngine

The OverlayEngine (and InsetEngine) that merges, cuts and sets back with JTS (see PolygonOverlay, whose grid it uses): what a host gives the DrawStateMachine to make DrawEvent.MergeWith and DrawEvent.CutBy work.

val machine = DrawStateMachine(history, repository, overlay = JtsOverlayEngine())

Parameters

gridSize

the size of a cell of the grid the overlay is done on, in degrees (see PolygonOverlay); the default closes the gaps and overlaps of 1e-7 degrees (about a centimetre) that two sources of the same border leave between them.

Constructors

Link copied to clipboard
constructor(gridSize: Double = PolygonOverlay.DEFAULT_GRID_SIZE)

Functions

Link copied to clipboard
open override fun difference(a: DrawnPolygon, b: DrawnPolygon, newVertexId: () -> VertexId): List<List<Vertex>>
Link copied to clipboard
open override fun inset(polygon: DrawnPolygon, distanceMeters: Double, newVertexId: () -> VertexId): List<List<Vertex>>
Link copied to clipboard
open override fun union(a: DrawnPolygon, b: DrawnPolygon, newVertexId: () -> VertexId): List<List<Vertex>>
Link copied to clipboard
open override fun validate(polygon: DrawnPolygon): String?