Skip to content

meos.js


meos.js / FloatSpanSet

Class: FloatSpanSet ​

Defined in: core/types/collections/number/FloatSpanSet.ts:35

An ordered set of disjoint FloatSpan values.

Example ​

ts
const ss = FloatSpanSet.fromString('{[1.5, 5.5), [8.0, 12.0)}');
console.log(ss.numSpans()); // 2
console.log(ss.lower());    // 1.5
console.log(ss.upper());    // 12.0
ss.free();

Extends ​

Constructors ​

Constructor ​

ts
new FloatSpanSet(inner): FloatSpanSet;

Defined in: core/types/collections/base/SpanSet.ts:63

Parameters ​

inner ​

number

Returns ​

FloatSpanSet

Inherited from ​

SpanSet.constructor

Accessors ​

inner ​

Get Signature ​

ts
get inner(): number;

Defined in: core/types/collections/base/SpanSet.ts:77

Raw WASM heap pointer. Do not free this value directly; use free.

Returns ​

number

Inherited from ​

SpanSet.inner

Methods ​

[dispose]() ​

ts
dispose: void;

Defined in: core/types/collections/base/SpanSet.ts:87

Implements the using resource-management protocol — calls free automatically.

Returns ​

void

Inherited from ​

SpanSet.[dispose]


asHexWKB() ​

ts
asHexWKB(variant?): string;

Defined in: core/types/collections/base/SpanSet.ts:110

Serialises this span set to a hex-encoded WKB string.

Parameters ​

variant? ​

number = 4

WKB encoding variant (default 4 = Extended WKB).

Returns ​

string

Inherited from ​

SpanSet.asHexWKB


boundingSpan() ​

ts
boundingSpan(): FloatSpan;

Defined in: core/types/collections/base/SpanSet.ts:154

Returns the smallest span that covers all spans in this set (the bounding span). The caller is responsible for calling Span.free on the result.

Returns ​

FloatSpan

Inherited from ​

SpanSet.boundingSpan


ceil() ​

ts
ceil(): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:135

Returns a new span set with all bounds rounded up to the nearest integer.

Returns ​

FloatSpanSet


contains() ​

ts
contains(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:209

true if this entirely contains other. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.contains


copy() ​

ts
copy(): this;

Defined in: core/types/collections/base/SpanSet.ts:95

Returns a deep copy of this span set. The caller is responsible for calling free on the returned copy.

Returns ​

this

Inherited from ​

SpanSet.copy


degrees() ​

ts
degrees(normalize?): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:148

Converts all bounds from radians to degrees.

Parameters ​

normalize? ​

boolean = false

If true, normalises the result to [0, 360) (default false).

Returns ​

FloatSpanSet


distance() ​

ts
distance(other): number;

Defined in: core/types/collections/number/FloatSpanSet.ts:116

Returns the distance (gap) between this and other. Returns 0 if they overlap. Accepts either a FloatSpan or a FloatSpanSet.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

number

Overrides ​

SpanSet.distance


endSpan() ​

ts
endSpan(): FloatSpan;

Defined in: core/types/collections/base/SpanSet.ts:170

Returns the last (rightmost) span in this set. The caller is responsible for calling Span.free on the result.

Returns ​

FloatSpan

Inherited from ​

SpanSet.endSpan


eq() ​

ts
eq(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:324

true if this and other are identical (same spans, bounds, and inclusivity).

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.eq


floor() ​

ts
floor(): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:140

Returns a new span set with all bounds rounded down to the nearest integer.

Returns ​

FloatSpanSet


free() ​

ts
free(): void;

Defined in: core/types/collections/base/SpanSet.ts:82

Releases the WASM-allocated memory. Must be called when the object is no longer needed.

Returns ​

void

Inherited from ​

SpanSet.free


ge() ​

ts
ge(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:349

true if this is greater than or equal to other in MEOS total ordering.

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.ge


gt() ​

ts
gt(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:344

true if this is strictly greater than other in MEOS total ordering.

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.gt


hash() ​

ts
hash(): number;

Defined in: core/types/collections/base/SpanSet.ts:146

32-bit integer hash of this span set.

Returns ​

number

Inherited from ​

SpanSet.hash


intersection() ​

ts
intersection(other): FloatSpanSet | null;

Defined in: core/types/collections/base/SpanSet.ts:285

Returns the intersection of this and other, or null if they are disjoint. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

FloatSpanSet | null

Inherited from ​

SpanSet.intersection


isAdjacent() ​

ts
isAdjacent(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:191

true if this and other share exactly one boundary point without overlapping. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isAdjacent


isAfter() ​

ts
isAfter(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:250

true if every point in this is strictly greater than every point in other. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isAfter


isBefore() ​

ts
isBefore(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:231

true if every point in this is strictly less than every point in other. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isBefore


isContainedIn() ​

ts
isContainedIn(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:200

true if this is entirely contained within other. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isContainedIn


isOverOrAfter() ​

ts
isOverOrAfter(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:260

true if this does not extend to the left of other (i.e. min(this) ≥ min(other)). Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isOverOrAfter


isOverOrBefore() ​

ts
isOverOrBefore(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:241

true if this does not extend to the right of other (i.e. max(this) ≤ max(other)). Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.isOverOrBefore


le() ​

ts
le(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:339

true if this is less than or equal to other in MEOS total ordering.

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.le


lower() ​

ts
lower(): number;

Defined in: core/types/collections/number/FloatSpanSet.ts:89

Returns the lower bound of the first span.

Returns ​

number

Overrides ​

SpanSet.lower


lowerInc() ​

ts
lowerInc(): boolean;

Defined in: core/types/collections/base/SpanSet.ts:131

true if the lower bound of the first span is inclusive ([).

Returns ​

boolean

Inherited from ​

SpanSet.lowerInc


lt() ​

ts
lt(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:334

true if this is strictly less than other in MEOS total ordering.

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.lt


minus() ​

ts
minus(other): FloatSpanSet | null;

Defined in: core/types/collections/base/SpanSet.ts:298

Returns the part of this that is not in other, or null if the result is empty. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

FloatSpanSet | null

Inherited from ​

SpanSet.minus


ne() ​

ts
ne(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:329

true if this and other differ in at least one span.

Parameters ​

other ​

this

Returns ​

boolean

Inherited from ​

SpanSet.ne


numSpans() ​

ts
numSpans(): number;

Defined in: core/types/collections/base/SpanSet.ts:141

Number of spans in this set.

Returns ​

number

Inherited from ​

SpanSet.numSpans


overlaps() ​

ts
overlaps(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:218

true if this and other share at least one point. Accepts either a companion span or another span set of the same type.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

boolean

Inherited from ​

SpanSet.overlaps


radians() ​

ts
radians(): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:153

Converts all bounds from degrees to radians.

Returns ​

FloatSpanSet


round() ​

ts
round(maxdd): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:161

Returns a new span set with all bounds rounded to maxdd decimal places.

Parameters ​

maxdd ​

number

Number of decimal digits to keep.

Returns ​

FloatSpanSet


shiftScale() ​

ts
shiftScale(
   shift, 
   width, 
   hasShift?, 
   hasWidth?): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:172

Returns a new span set shifted and/or scaled along the float axis.

Parameters ​

shift ​

number

Amount to add to every bound (ignored when hasShift is false).

width ​

number

New total width (ignored when hasWidth is false).

hasShift? ​

boolean = true

Set to false to skip shifting (default true).

hasWidth? ​

boolean = true

Set to false to skip scaling (default true).

Returns ​

FloatSpanSet


spanN() ​

ts
spanN(n): FloatSpan;

Defined in: core/types/collections/base/SpanSet.ts:179

Returns the n-th span (0-based index). The caller is responsible for calling Span.free on the result.

Parameters ​

n ​

number

0-based index (MEOS internally uses 1-based indexing).

Returns ​

FloatSpan

Inherited from ​

SpanSet.spanN


startSpan() ​

ts
startSpan(): FloatSpan;

Defined in: core/types/collections/base/SpanSet.ts:162

Returns the first (leftmost) span in this set. The caller is responsible for calling Span.free on the result.

Returns ​

FloatSpan

Inherited from ​

SpanSet.startSpan


toIntSpanSet() ​

ts
toIntSpanSet(): number;

Defined in: core/types/collections/number/FloatSpanSet.ts:130

Converts this set to an IntSpanSet by truncating each span's bounds and returns the raw WASM pointer. Use new IntSpanSet(ptr) to obtain a typed object.

Returns ​

number


toString() ​

ts
toString(maxdd?): string;

Defined in: core/types/collections/number/FloatSpanSet.ts:80

Returns the WKT string representation (e.g. {[1.5, 5.5), [8.0, 12.0)}).

Parameters ​

maxdd? ​

number = 15

Maximum decimal digits of precision (default 15).

Returns ​

string

Overrides ​

SpanSet.toString


union() ​

ts
union(other): this;

Defined in: core/types/collections/base/SpanSet.ts:311

Returns the union of this and other. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters ​

other ​

FloatSpan | FloatSpanSet

Returns ​

this

Inherited from ​

SpanSet.union


upper() ​

ts
upper(): number;

Defined in: core/types/collections/number/FloatSpanSet.ts:94

Returns the upper bound of the last span.

Returns ​

number

Overrides ​

SpanSet.upper


upperInc() ​

ts
upperInc(): boolean;

Defined in: core/types/collections/base/SpanSet.ts:136

true if the upper bound of the last span is inclusive (]).

Returns ​

boolean

Inherited from ​

SpanSet.upperInc


width() ​

ts
width(boundSpan?): number;

Defined in: core/types/collections/number/FloatSpanSet.ts:104

Returns the total width of this span set.

Parameters ​

boundSpan? ​

boolean = false

false (default): sum of all individual span widths.

  • true: width of the bounding span (from first lower to last upper).

Returns ​

number


fromHexWKB() ​

ts
static fromHexWKB(hexwkb): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:60

Deserialises a FloatSpanSet from a hex-encoded WKB string produced by asHexWKB.

Parameters ​

hexwkb ​

string

Hex-encoded WKB string.

Returns ​

FloatSpanSet


fromSpan() ​

ts
static fromSpan(span): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:68

Wraps a single FloatSpan into a one-element FloatSpanSet.

Parameters ​

span ​

FloatSpan

The span to wrap.

Returns ​

FloatSpanSet


fromString() ​

ts
static fromString(str): FloatSpanSet;

Defined in: core/types/collections/number/FloatSpanSet.ts:52

Parses a FloatSpanSet from its WKT string representation.

Parameters ​

str ​

string

WKT string, e.g. "{[1.5, 5.5), [8.0, 12.0)}".

Returns ​

FloatSpanSet