ShapeField

object ShapeField

A base shape utility class used for both LatLon (spherical) and XY (cartesian) shape fields.

Polygon's and Line's are decomposed into a triangular mesh using the [ ] utility class. Each Triangle is encoded by this base class and indexed as a seven dimension multi-value field.

Finding all shapes that intersect a range (e.g., bounding box), or target shape, at search time is efficient.

This class defines the static methods for encoding the three vertices of a tessellated triangles as a seven dimension point. The coordinates are converted from double precision values into 32 bit integers so they are sortable at index time.

Types

Link copied to clipboard

Represents a encoded triangle using ShapeField.decodeTriangle.

Link copied to clipboard

Query Relation Types *

Link copied to clipboard
open class Triangle : Field

polygons are decomposed into tessellated triangles using [ ] these triangles are encoded and inserted as separate indexed POINT fields

Properties

Link copied to clipboard
const val BYTES: Int

vertex coordinates are encoded as 4 byte integers

Functions

Link copied to clipboard

Decode a triangle encoded by ShapeField.encodeTriangle.

Link copied to clipboard
fun encodeTriangle(bytes: ByteArray, aY: Int, aX: Int, ab: Boolean, bY: Int, bX: Int, bc: Boolean, cY: Int, cX: Int, ca: Boolean)

A triangle is encoded using 6 points and an extra point with encoded information in three bits of how to reconstruct it. Triangles are encoded with CCW orientation and might be rotated to limit the number of possible reconstructions to 2^3. Reconstruction always happens from west to east.

Link copied to clipboard