GeometryRef
Class representing a GEOS geometry that exists in the Wasm memory.
Type Parameters
P- The type of optional data assigned to a geometry instance. Similar to the type of GeoJSONFeatureproperties field.
Properties
type readonly
'Point' | 'LineString' | 'LinearRing' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection' | 'CircularString' | 'CompoundCurve' | 'CurvePolygon' | 'MultiCurve' | 'MultiSurface'
Geometry type
id optional
number | string
Geometry identifier, either number or string.
Equivalent of GeoJSON feature id.
props
detached optional
boolean
Geometry can become detached when passed to a function that consumes
it, for example geometryCollection, or when manually
freed. Although this Geometry object still exists, the GEOS
object that it used to represent no longer exists.
Methods
normalize
() -> this
Organizes the elements, rings, and coordinate order of geometries in a consistent way, so that geometries that represent the same object can be easily compared.
orientPolygons
(exterior: 'cw' | 'ccw') -> this
Enforces a ring orientation on all polygonal elements in the input geometry.
clone
() -> GeometryRef<P>
Creates a deep copy of this geometry object.
toJSON
() -> JSON_Feature<JSON_Geometry, P>
Converts the geometry to a GeoJSON Feature object.
free
() -> void
Frees the Wasm memory allocated for the GEOS geometry object.