/** Other WebAssembly declarations, for compatibility with older versions of Typescript */ declare namespace WebAssembly { interface Module {} } declare namespace Emscripten { interface FileSystemType { mount(mount: FS.Mount): FS.FSNode; syncfs(mount: FS.Mount, populate: () => unknown, done: (err?: number | null) => unknown): void; } type EnvironmentType = "WEB" | "NODE" | "SHELL" | "WORKER"; type JSType = "number" | "string" | "array" | "boolean"; type TypeCompatibleWithC = number | string | any[] | boolean; type CIntType = "i8" | "i16" | "i32" | "i64"; type CFloatType = "float" | "double"; type CPointerType = "i8*" | "i16*" | "i32*" | "i64*" | "float*" | "double*" | "*"; type CType = CIntType | CFloatType | CPointerType; interface CCallOpts { async?: boolean | undefined; } } interface EmscriptenModule { print(str: string): void; printErr(str: string): void; arguments: string[]; environment: Emscripten.EnvironmentType; preInit: Array<{ (): void }>; preRun: Array<{ (): void }>; postRun: Array<{ (): void }>; onAbort: { (what: any): void }; onRuntimeInitialized: { (): void }; preinitializedWebGLContext: WebGLRenderingContext; noInitialRun: boolean; noExitRuntime: boolean; logReadFiles: boolean; filePackagePrefixURL: string; wasmBinary: ArrayBuffer; destroy(object: object): void; getPreloadedPackage(remotePackageName: string, remotePackageSize: number): ArrayBuffer; instantiateWasm( imports: WebAssembly.Imports, successCallback: (module: WebAssembly.Instance) => void, ): WebAssembly.Exports | undefined; locateFile(url: string, scriptDirectory: string): string; onCustomMessage(event: MessageEvent): void; // USE_TYPED_ARRAYS == 1 HEAP: Int32Array; IHEAP: Int32Array; FHEAP: Float64Array; // USE_TYPED_ARRAYS == 2 HEAP8: Int8Array; HEAP16: Int16Array; HEAP32: Int32Array; HEAPU8: Uint8Array; HEAPU16: Uint16Array; HEAPU32: Uint32Array; HEAPF32: Float32Array; HEAPF64: Float64Array; HEAP64: BigInt64Array; HEAPU64: BigUint64Array; TOTAL_STACK: number; TOTAL_MEMORY: number; FAST_MEMORY: number; addOnPreRun(cb: () => any): void; addOnInit(cb: () => any): void; addOnPreMain(cb: () => any): void; addOnExit(cb: () => any): void; addOnPostRun(cb: () => any): void; preloadedImages: any; preloadedAudios: any; _malloc(size: number): number; _free(ptr: number): void; } /** * A factory function is generated when setting the `MODULARIZE` build option * to `1` in your Emscripten build. It return a Promise that resolves to an * initialized, ready-to-call `EmscriptenModule` instance. * * By default, the factory function will be named `Module`. It's recommended to * use the `EXPORT_ES6` option, in which the factory function will be the * default export. If used without `EXPORT_ES6`, the factory function will be a * global variable. You can rename the variable using the `EXPORT_NAME` build * option. It's left to you to declare any global variables as needed in your * application's types. * @param moduleOverrides Default properties for the initialized module. */ type EmscriptenModuleFactory = ( moduleOverrides?: Partial, ) => Promise; declare namespace FS { interface Lookup { path: string; node: FSNode; } interface Analyze { isRoot: boolean; exists: boolean; error: Error; name: string; path: Lookup["path"]; object: Lookup["node"]; parentExists: boolean; parentPath: Lookup["path"]; parentObject: Lookup["node"]; } interface Mount { type: Emscripten.FileSystemType; opts: object; mountpoint: string; mounts: Mount[]; root: FSNode; } class FSStream { constructor(); object: FSNode; readonly isRead: boolean; readonly isWrite: boolean; readonly isAppend: boolean; flags: number; position: number; fd?: number; nfd?: number; } interface StreamOps { open(stream: FSStream): void; close(stream: FSStream): void; read(stream: FSStream, buffer: Uint8Array, offset: number, length: number, position: number): number; write(stream: FSStream, buffer: Uint8Array, offset: number, length: number, position: number): number; llseek(stream: FSStream, offset: number, whence: number): number; } class FSNode { parent: FSNode; mount: Mount; mounted?: Mount; id: number; name: string; mode: number; rdev: number; readMode: number; writeMode: number; constructor(parent: FSNode, name: string, mode: number, rdev: number); read: boolean; write: boolean; readonly isFolder: boolean; readonly isDevice: boolean; } interface NodeOps { getattr(node: FSNode): Stats; setattr(node: FSNode, attr: Stats): void; lookup(parent: FSNode, name: string): FSNode; mknod(parent: FSNode, name: string, mode: number, dev: unknown): FSNode; rename(oldNode: FSNode, newDir: FSNode, newName: string): void; unlink(parent: FSNode, name: string): void; rmdir(parent: FSNode, name: string): void; readdir(node: FSNode): string[]; symlink(parent: FSNode, newName: string, oldPath: string): void; readlink(node: FSNode): string; } interface Stats { dev: number; ino: number; mode: number; nlink: number; uid: number; gid: number; rdev: number; size: number; blksize: number; blocks: number; atime: Date; mtime: Date; ctime: Date; timestamp?: number; } class ErrnoError extends Error { name: "ErronoError"; errno: number; code: string; constructor(errno: number); } let ignorePermissions: boolean; let trackingDelegate: { onOpenFile(path: string, trackingFlags: number): unknown; onCloseFile(path: string): unknown; onSeekFile(path: string, position: number, whence: number): unknown; onReadFile(path: string, bytesRead: number): unknown; onWriteToFile(path: string, bytesWritten: number): unknown; onMakeDirectory(path: string, mode: number): unknown; onMakeSymlink(oldpath: string, newpath: string): unknown; willMovePath(old_path: string, new_path: string): unknown; onMovePath(old_path: string, new_path: string): unknown; willDeletePath(path: string): unknown; onDeletePath(path: string): unknown; }; let tracking: any; let genericErrors: Record; // // paths // function lookupPath( path: string, opts: Partial<{ follow_mount: boolean; /** * by default, lookupPath will not follow a symlink if it is the final path component. * setting opts.follow = true will override this behavior. */ follow: boolean; recurse_count: number; parent: boolean; }>, ): Lookup; function getPath(node: FSNode): string; function analyzePath(path: string, dontResolveLastLink?: boolean): Analyze; // // nodes // function isFile(mode: number): boolean; function isDir(mode: number): boolean; function isLink(mode: number): boolean; function isChrdev(mode: number): boolean; function isBlkdev(mode: number): boolean; function isFIFO(mode: number): boolean; function isSocket(mode: number): boolean; // // devices // function major(dev: number): number; function minor(dev: number): number; function makedev(ma: number, mi: number): number; function registerDevice(dev: number, ops: Partial): void; function getDevice(dev: number): { stream_ops: StreamOps }; // // core // function getMounts(mount: Mount): Mount[]; function syncfs(populate: boolean, callback: (e: any) => any): void; function syncfs(callback: (e: any) => any, populate?: boolean): void; function mount(type: Emscripten.FileSystemType, opts: any, mountpoint: string): any; function unmount(mountpoint: string): void; function mkdir(path: string, mode?: number): FSNode; function mkdev(path: string, mode?: number, dev?: number): FSNode; function symlink(oldpath: string, newpath: string): FSNode; function rename(old_path: string, new_path: string): void; function rmdir(path: string): void; function readdir(path: string): string[]; function unlink(path: string): void; function readlink(path: string): string; function stat(path: string, dontFollow?: boolean): Stats; function lstat(path: string): Stats; function chmod(path: string, mode: number, dontFollow?: boolean): void; function lchmod(path: string, mode: number): void; function fchmod(fd: number, mode: number): void; function chown(path: string, uid: number, gid: number, dontFollow?: boolean): void; function lchown(path: string, uid: number, gid: number): void; function fchown(fd: number, uid: number, gid: number): void; function truncate(path: string, len: number): void; function ftruncate(fd: number, len: number): void; function utime(path: string, atime: number, mtime: number): void; function open(path: string, flags: string, mode?: number, fd_start?: number, fd_end?: number): FSStream; function close(stream: FSStream): void; function llseek(stream: FSStream, offset: number, whence: number): number; function read(stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number): number; function write( stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position?: number, canOwn?: boolean, ): number; function allocate(stream: FSStream, offset: number, length: number): void; function mmap( stream: FSStream, buffer: ArrayBufferView, offset: number, length: number, position: number, prot: number, flags: number, ): { allocated: boolean; ptr: number; }; function ioctl(stream: FSStream, cmd: any, arg: any): any; function readFile(path: string, opts: { encoding: "binary"; flags?: string | undefined }): Uint8Array; function readFile(path: string, opts: { encoding: "utf8"; flags?: string | undefined }): string; function readFile(path: string, opts?: { flags?: string | undefined }): Uint8Array; function writeFile(path: string, data: string | ArrayBufferView, opts?: { flags?: string | undefined }): void; // // module-level FS code // function cwd(): string; function chdir(path: string): void; function init( input: null | (() => number | null), output: null | ((c: number) => any), error: null | ((c: number) => any), ): void; function createLazyFile( parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, ): FSNode; function createPreloadedFile( parent: string | FSNode, name: string, url: string, canRead: boolean, canWrite: boolean, onload?: () => void, onerror?: () => void, dontCreateFile?: boolean, canOwn?: boolean, ): void; function createDataFile( parent: string | FSNode, name: string, data: ArrayBufferView, canRead: boolean, canWrite: boolean, canOwn: boolean, ): FSNode; } declare var MEMFS: Emscripten.FileSystemType; declare var NODEFS: Emscripten.FileSystemType; declare var IDBFS: Emscripten.FileSystemType; // https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html type StringToType = R extends Emscripten.JSType ? { number: number; string: string; array: number[] | string[] | boolean[] | Uint8Array | Int8Array; boolean: boolean; null: null; }[R] : never; type ArgsToType> = Extract< { [P in keyof T]: StringToType; }, any[] >; type ReturnToType = R extends null ? null : StringToType>; // Below runtime function/variable declarations are exportable by // -s EXTRA_EXPORTED_RUNTIME_METHODS. You can extend or merge // EmscriptenModule interface to add runtime functions. // // For example, by using -s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']" // You can access ccall() via Module["ccall"]. In this case, you should // extend EmscriptenModule to pass the compiler check like the following: // // interface YourOwnEmscriptenModule extends EmscriptenModule { // ccall: typeof ccall; // } // // See: https://emscripten.org/docs/getting_started/FAQ.html#why-do-i-get-typeerror-module-something-is-not-a-function declare function cwrap | [], R extends Emscripten.JSType | null>( ident: string, returnType: R, argTypes: I, opts?: Emscripten.CCallOpts, ): (...arg: ArgsToType) => ReturnToType; declare function ccall | [], R extends Emscripten.JSType | null>( ident: string, returnType: R, argTypes: I, args: ArgsToType, opts?: Emscripten.CCallOpts, ): ReturnToType; declare function setValue(ptr: number, value: any, type: Emscripten.CType, noSafe?: boolean): void; declare function getValue(ptr: number, type: Emscripten.CType, noSafe?: boolean): number; declare function allocate( slab: number[] | ArrayBufferView | number, types: Emscripten.CType | Emscripten.CType[], allocator: number, ptr?: number, ): number; declare function stackAlloc(size: number): number; declare function stackSave(): number; declare function stackRestore(ptr: number): void; declare function UTF8ToString(ptr: number, maxBytesToRead?: number): string; declare function stringToUTF8(str: string, outPtr: number, maxBytesToRead?: number): void; declare function lengthBytesUTF8(str: string): number; declare function allocateUTF8(str: string): number; declare function allocateUTF8OnStack(str: string): number; declare function UTF16ToString(ptr: number): string; declare function stringToUTF16(str: string, outPtr: number, maxBytesToRead?: number): void; declare function lengthBytesUTF16(str: string): number; declare function UTF32ToString(ptr: number): string; declare function stringToUTF32(str: string, outPtr: number, maxBytesToRead?: number): void; declare function lengthBytesUTF32(str: string): number; declare function intArrayFromString(stringy: string, dontAddNull?: boolean, length?: number): number[]; declare function intArrayToString(array: number[]): string; declare function writeStringToMemory(str: string, buffer: number, dontAddNull: boolean): void; declare function writeArrayToMemory(array: number[], buffer: number): void; declare function writeAsciiToMemory(str: string, buffer: number, dontAddNull: boolean): void; declare function addRunDependency(id: any): void; declare function removeRunDependency(id: any): void; declare function addFunction(func: (...args: any[]) => any, signature?: string): number; declare function removeFunction(funcPtr: number): void; declare var ALLOC_NORMAL: number; declare var ALLOC_STACK: number; declare var ALLOC_STATIC: number; declare var ALLOC_DYNAMIC: number; declare var ALLOC_NONE: number; interface Module extends EmscriptenModule { /** * Allocates memory on the Emscripten heap. * @param size - The size of the memory to allocate. * @returns number - The pointer to the allocated memory. * @see https://emscripten.org/docs/api_reference/preamble.js.html#_malloc */ _malloc(size: number): number; /** * Reads a value from the Emscripten heap. * @param ptr - The pointer to the value. * @param type - The type of the value. * @returns number - The value. * @see https://emscripten.org/docs/api_reference/preamble.js.html#getValue */ getValue(ptr: number, type: string): number; /** * Writes a value to the Emscripten heap. * @param ptr - The pointer to the value. * @param type - The type of the value. * @param value - The value. * @see https://emscripten.org/docs/api_reference/preamble.js.html#setValue */ setValue(ptr: number, type: string, value: number): void; /** * Reads a null-terminated string from the Emscripten heap. * @param ptr - The pointer to the string. * @returns string - The string. * @see https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString */ UTF8ToString(ptr: number): string; /** * Writes a string to the Emscripten heap. * @param str - The string. * @param ptr - The pointer to the string. * @param maxLength - The maximum length of the string. * @see https://emscripten.org/docs/api_reference/preamble.js.html#stringToUTF8 */ stringToUTF8(str: string, ptr: number, maxLength: number): void; } type StringPointer = number type NumberPointer = number type ArrayPointer = number type Pointer = StringPointer type GEOSBufferParams = number type GEOSContextHandle_t = number type GEOSCoordSequence = number type GEOSDistanceCallback = function type GEOSGeoJSONReader = number type GEOSGeoJSONWriter = number type GEOSGeometry = number type GEOSInterruptCallback = function type GEOSMakeValidParams = number type GEOSMessageHandler = function type GEOSMessageHandler_r = function type GEOSPreparedGeometry = number type GEOSQueryCallback = function type GEOSSTRtree = number type GEOSTransformXYCallback = function type GEOSWKBReader = number type GEOSWKBWriter = number type GEOSWKTReader = number type GEOSWKTWriter = number export enum GEOSBufCapStyles { GEOSBUF_CAP_ROUND = 1, GEOSBUF_CAP_FLAT = 2, GEOSBUF_CAP_SQUARE = 3 } export enum GEOSBufJoinStyles { GEOSBUF_JOIN_ROUND = 1, GEOSBUF_JOIN_MITRE = 2, GEOSBUF_JOIN_BEVEL = 3 } export enum GEOSGeomTypes { GEOS_POINT = 0, GEOS_LINESTRING = 1, GEOS_LINEARRING = 2, GEOS_POLYGON = 3, GEOS_MULTIPOINT = 4, GEOS_MULTILINESTRING = 5, GEOS_MULTIPOLYGON = 6, GEOS_GEOMETRYCOLLECTION = 7 } export enum GEOSMakeValidMethods { GEOS_MAKE_VALID_LINEWORK = 0, GEOS_MAKE_VALID_STRUCTURE = 1 } export enum GEOSPolygonHullParameterModes { GEOSHULL_PARAM_VERTEX_RATIO = 1, GEOSHULL_PARAM_AREA_RATIO = 2 } export enum GEOSPrecisionRules { GEOS_PREC_VALID_OUTPUT = 0, GEOS_PREC_NO_TOPO = 1, GEOS_PREC_KEEP_COLLAPSED = 2 } export enum GEOSRelateBoundaryNodeRules { GEOSRELATE_BNR_MOD2 = 1, GEOSRELATE_BNR_OGC = 1, GEOSRELATE_BNR_ENDPOINT = 2, GEOSRELATE_BNR_MULTIVALENT_ENDPOINT = 3, GEOSRELATE_BNR_MONOVALENT_ENDPOINT = 4 } export enum GEOSValidFlags { GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE = 1 } export enum GEOSVoronoiFlags { GEOS_VORONOI_ONLY_EDGES = 1, GEOS_VORONOI_PRESERVE_ORDER = 2 } export enum GEOSWKBByteOrders { GEOS_WKB_XDR = 0, GEOS_WKB_NDR = 1 } export enum GEOSWKBFlavors { GEOS_WKB_EXTENDED = 1, GEOS_WKB_ISO = 2 } interface geos { GEOSBufCapStyles: typeof GEOSBufCapStyles GEOSBufJoinStyles: typeof GEOSBufJoinStyles GEOSGeomTypes: typeof GEOSGeomTypes GEOSMakeValidMethods: typeof GEOSMakeValidMethods GEOSPolygonHullParameterModes: typeof GEOSPolygonHullParameterModes GEOSPrecisionRules: typeof GEOSPrecisionRules GEOSRelateBoundaryNodeRules: typeof GEOSRelateBoundaryNodeRules GEOSValidFlags: typeof GEOSValidFlags GEOSVoronoiFlags: typeof GEOSVoronoiFlags GEOSWKBByteOrders: typeof GEOSWKBByteOrders GEOSWKBFlavors: typeof GEOSWKBFlavors /** * Cleans up GEOS and releases any allocated resources. * @see https://libgeos.org/doxygen/geos__c_8h.html#a9a6f9f0b3a4c1a2e7c1d0e4e1b3a2c5d */ finishGEOS(): void; /** * Initializes GEOS and allocates any required resources. * @see https://libgeos.org/doxygen/geos__c_8h.html#a9a6f9f0b3a4c1a2e7c1d0e4e1b3a2c5d */ initGEOS(): void; /** * For non-reentrant code, call when all GEOS operations are complete, cleans up global resources. * @returns null - void */ finishGEOS(): null; /** * @param handle - - * @returns null - void */ finishGEOS_r(handle: GEOSContextHandle_t): null; /** * Free the memory associated with a GEOSContextHandle_t when you are finished calling GEOS functions. * @param handle - to be freed * @returns null - void */ GEOS_finish_r(handle: GEOSContextHandle_t): null; /** * @returns number - int */ GEOS_getWKBByteOrder(): number; /** * @param handle - - * @returns number - int */ GEOS_getWKBByteOrder_r(handle: GEOSContextHandle_t): number; /** * @returns number - int */ GEOS_getWKBOutputDims(): number; /** * @param handle - - * @returns number - int */ GEOS_getWKBOutputDims_r(handle: GEOSContextHandle_t): number; /** * Allocate and initialize a context. Pass this context as the first argument when calling other *_r functions. Contexts must only be used from a single thread at a time. * @returns GEOSContextHandle_t - a new GEOS context. */ GEOS_init_r(): GEOSContextHandle_t; /** * Cancel a pending interruption request * @returns null - void */ GEOS_interruptCancel(): null; /** * Register a function to be called when processing is interrupted. * @param cb - Callback function to invoke * @returns GEOSInterruptCallback - the previously configured callback */ GEOS_interruptRegisterCallback(cb: GEOSInterruptCallback): GEOSInterruptCallback; /** * Request safe interruption of operations * @returns null - void */ GEOS_interruptRequest(): null; /** * Print the shortest representation of a double. Non-zero absolute values that are <1e-4 and >=1e+17 are formatted using scientific notation, and other values are formatted with positional notation with precision used for the max digits after decimal point. * @param d - The number to format. * @param precision - The desired precision. * @param result - The buffer to write the result to, with a suggested size 28. * @returns number - the length of the written string. */ GEOS_printDouble(d: number, precision: number, result: StringPointer): number; /** * @param byteOrder - - * @returns number - int */ GEOS_setWKBByteOrder(byteOrder: number): number; /** * @param handle - - * @param byteOrder - - * @returns number - int */ GEOS_setWKBByteOrder_r(handle: GEOSContextHandle_t, byteOrder: number): number; /** * @param newDims - - * @returns number - int */ GEOS_setWKBOutputDims(newDims: number): number; /** * @param handle - - * @param newDims - - * @returns number - int */ GEOS_setWKBOutputDims_r(handle: GEOSContextHandle_t, newDims: number): number; /** * Calculate the area of a geometry. * @param g - Input geometry * @param area - Pointer to be filled in with area result * @returns number - 1 on success, 0 on exception. */ GEOSArea(g: GEOSGeometry, area: NumberPointer): number; /** * Calculate the area of a geometry. * @param handle - - * @param g - Input geometry * @param area - Pointer to be filled in with area result * @returns number - 1 on success, 0 on exception. */ GEOSArea_r(handle: GEOSContextHandle_t, g: GEOSGeometry, area: NumberPointer): number; /** * Returns the "boundary" of a geometry, as defined by the DE9IM: * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the boundary. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBoundary(g: GEOSGeometry): GEOSGeometry; /** * Returns the "boundary" of a geometry, as defined by the DE9IM: * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the boundary. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBoundary_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Buffer a geometry. * @param g - The input geometry to be buffered. * @param width - The distance by which to expand the geometry (or contract) if the value is negative. * @param quadsegs - The number of segments per quadrant to generate. More segments provides a more "precise" buffer at the expense of size. * @returns GEOSGeometry - A GEOSGeometry of the buffered result. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBuffer(g: GEOSGeometry, width: number, quadsegs: number): GEOSGeometry; /** * Buffer a geometry. * @param handle - - * @param g - The input geometry to be buffered. * @param width - The distance by which to expand the geometry (or contract) if the value is negative. * @param quadsegs - The number of segments per quadrant to generate. More segments provides a more "precise" buffer at the expense of size. * @returns GEOSGeometry - A GEOSGeometry of the buffered result. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBuffer_r(handle: GEOSContextHandle_t, g: GEOSGeometry, width: number, quadsegs: number): GEOSGeometry; /** * Create a default GEOSBufferParams object for controlling the shape of buffered generated by GEOSBuffer. * @returns GEOSBufferParams - A newly allocated GEOSBufferParams. NULL on exception. Caller is responsible for freeing with GEOSBufferParams_destroy(). */ GEOSBufferParams_create(): GEOSBufferParams; /** * Create a default GEOSBufferParams object for controlling the shape of buffered generated by GEOSBuffer. * @param handle - - * @returns GEOSBufferParams - A newly allocated GEOSBufferParams. NULL on exception. Caller is responsible for freeing with GEOSBufferParams_destroy(). */ GEOSBufferParams_create_r(handle: GEOSContextHandle_t): GEOSBufferParams; /** * Destroy a GEOSBufferParams and free all associated memory. * @param parms - The object to destroy. * @returns null - void */ GEOSBufferParams_destroy(parms: GEOSBufferParams): null; /** * Destroy a GEOSBufferParams and free all associated memory. * @param handle - - * @param parms - The object to destroy. * @returns null - void */ GEOSBufferParams_destroy_r(handle: GEOSContextHandle_t, parms: GEOSBufferParams): null; /** * Set the end cap type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufCapStyles. * @param p - - * @param style - - * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setEndCapStyle(p: GEOSBufferParams, style: number): number; /** * Set the end cap type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufCapStyles. * @param handle - - * @param p - - * @param style - - * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setEndCapStyle_r(handle: GEOSContextHandle_t, p: GEOSBufferParams, style: number): number; /** * Set the join type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufJoinStyles. * @param p - - * @param joinStyle - - * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setJoinStyle(p: GEOSBufferParams, joinStyle: number): number; /** * Set the join type of a GEOSBufferParams to the desired style, which must be one enumerated in GEOSBufJoinStyles. * @param handle - - * @param p - - * @param joinStyle - - * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setJoinStyle_r(handle: GEOSContextHandle_t, p: GEOSBufferParams, joinStyle: number): number; /** * Set the mitre limit of a GEOSBufferParams to the desired size. For acute angles, a mitre join can extend very very far from the input geometry, which is probably not desired. The mitre limit places an upper bound on that. * @param p - The GEOSBufferParams to operate on * @param mitreLimit - The limit to set * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setMitreLimit(p: GEOSBufferParams, mitreLimit: number): number; /** * Set the mitre limit of a GEOSBufferParams to the desired size. For acute angles, a mitre join can extend very very far from the input geometry, which is probably not desired. The mitre limit places an upper bound on that. * @param handle - - * @param p - The GEOSBufferParams to operate on * @param mitreLimit - The limit to set * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setMitreLimit_r(handle: GEOSContextHandle_t, p: GEOSBufferParams, mitreLimit: number): number; /** * Set the number of segments to use to stroke each quadrant of circular arcs generated by the buffering process. More segments means a smoother output, but with larger size. * @param p - The GEOSBufferParams to operate on * @param quadSegs - Number of segments per quadrant * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setQuadrantSegments(p: GEOSBufferParams, quadSegs: number): number; /** * Set the number of segments to use to stroke each quadrant of circular arcs generated by the buffering process. More segments means a smoother output, but with larger size. * @param handle - - * @param p - The GEOSBufferParams to operate on * @param quadSegs - Number of segments per quadrant * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setQuadrantSegments_r(handle: GEOSContextHandle_t, p: GEOSBufferParams, quadSegs: number): number; /** * Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line. * @param p - The GEOSBufferParams to operate on * @param singleSided - Set to 1 for single-sided output 0 otherwise * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setSingleSided(p: GEOSBufferParams, singleSided: number): number; /** * Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line. * @param handle - - * @param p - The GEOSBufferParams to operate on * @param singleSided - Set to 1 for single-sided output 0 otherwise * @returns number - 0 on exception, 1 on success. */ GEOSBufferParams_setSingleSided_r(handle: GEOSContextHandle_t, p: GEOSBufferParams, singleSided: number): number; /** * Generates a buffer using the special parameters in the GEOSBufferParams * @param g - The geometry to buffer * @param p - The parameters to apply to the buffer process * @param width - The buffer distance * @returns GEOSGeometry - The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBufferWithParams(g: GEOSGeometry, p: GEOSBufferParams, width: number): GEOSGeometry; /** * Generates a buffer using the special parameters in the GEOSBufferParams * @param handle - - * @param g - The geometry to buffer * @param p - The parameters to apply to the buffer process * @param width - The buffer distance * @returns GEOSGeometry - The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBufferWithParams_r(handle: GEOSContextHandle_t, g: GEOSGeometry, p: GEOSBufferParams, width: number): GEOSGeometry; /** * Generate a buffer using the provided style parameters. * @param g - The geometry to buffer * @param width - Width of the buffer * @param quadsegs - Number of segments per quadrant * @param endCapStyle - See GEOSBufCapStyles * @param joinStyle - See GEOSBufJoinStyles * @param mitreLimit - See GEOSBufferParams_setMitreLimit * @returns GEOSGeometry - The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBufferWithStyle(g: GEOSGeometry, width: number, quadsegs: number, endCapStyle: number, joinStyle: number, mitreLimit: number): GEOSGeometry; /** * Generate a buffer using the provided style parameters. * @param handle - - * @param g - The geometry to buffer * @param width - Width of the buffer * @param quadsegs - Number of segments per quadrant * @param endCapStyle - See GEOSBufCapStyles * @param joinStyle - See GEOSBufJoinStyles * @param mitreLimit - See GEOSBufferParams_setMitreLimit * @returns GEOSGeometry - The buffered geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBufferWithStyle_r(handle: GEOSContextHandle_t, g: GEOSGeometry, width: number, quadsegs: number, endCapStyle: number, joinStyle: number, mitreLimit: number): GEOSGeometry; /** * Perform a polygonization using all the linework, assuming that rings contained within rings are empty holes, rather then extra polygons. * @param g - The input linework * @returns GEOSGeometry - The polygonal output Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBuildArea(g: GEOSGeometry): GEOSGeometry; /** * Perform a polygonization using all the linework, assuming that rings contained within rings are empty holes, rather then extra polygons. * @param handle - - * @param g - The input linework * @returns GEOSGeometry - The polygonal output Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSBuildArea_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Intersection optimized for a rectangular clipping polygon. Supposed to be faster than using GEOSIntersection(). Not guaranteed to return valid results. * @param g - The input geometry to be clipped * @param xmin - Left bound of clipping rectangle * @param ymin - Lower bound of clipping rectangle * @param xmax - Right bound of clipping rectangle * @param ymax - Upper bound of clipping rectangle * @returns GEOSGeometry - The clipped geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSClipByRect(g: GEOSGeometry, xmin: number, ymin: number, xmax: number, ymax: number): GEOSGeometry; /** * Intersection optimized for a rectangular clipping polygon. Supposed to be faster than using GEOSIntersection(). Not guaranteed to return valid results. * @param handle - - * @param g - The input geometry to be clipped * @param xmin - Left bound of clipping rectangle * @param ymin - Lower bound of clipping rectangle * @param xmax - Right bound of clipping rectangle * @param ymax - Upper bound of clipping rectangle * @returns GEOSGeometry - The clipped geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSClipByRect_r(handle: GEOSContextHandle_t, g: GEOSGeometry, xmin: number, ymin: number, xmax: number, ymax: number): GEOSGeometry; /** * Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry. * @param g - The input geometry * @param ratio - The edge length ratio value, between 0 and 1. * @param allowHoles - When non-zero, the polygonal output may contain holes. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHull(g: GEOSGeometry, ratio: number, allowHoles: number): GEOSGeometry; /** * Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry. * @param handle - - * @param g - The input geometry * @param ratio - The edge length ratio value, between 0 and 1. * @param allowHoles - When non-zero, the polygonal output may contain holes. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHull_r(handle: GEOSContextHandle_t, g: GEOSGeometry, ratio: number, allowHoles: number): GEOSGeometry; /** * Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry. * @param g - The input geometry * @param length - The maximum edge length (0 or greater) * @param allowHoles - When non-zero, the polygonal output may contain holes. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHullByLength(g: GEOSGeometry, length: number, allowHoles: number): GEOSGeometry; /** * Returns a "concave hull" of a geometry. A concave hull is a polygon which contains all the points of the input, but is a better approximation than the convex hull to the area occupied by the input. Frequently used to convert a multi-point into a polygonal area. that contains all the points in the input Geometry. * @param handle - - * @param g - The input geometry * @param ratio - The maximum edge length (0 or greater) * @param allowHoles - When non-zero, the polygonal output may contain holes. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHullByLength_r(handle: GEOSContextHandle_t, g: GEOSGeometry, ratio: number, allowHoles: number): GEOSGeometry; /** * Constructs a concave hull of a set of polygons, respecting the polygons as constraints. * @param g - the valid MultiPolygon geometry to process * @param lengthRatio - specifies the Maximum Edge Length as a fraction of the difference between the longest and shortest edge lengths between the polygons. This normalizes the Maximum Edge Length to be scale-free. A value of 1 produces the convex hull; a value of 0 produces the original polygons. * @param isTight - is the concave hull allowed to contain holes? * @param isHolesAllowed - does the hull follow the outer boundaries of the input polygons. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHullOfPolygons(g: GEOSGeometry, lengthRatio: number, isTight: number, isHolesAllowed: number): GEOSGeometry; /** * Constructs a concave hull of a set of polygons, respecting the polygons as constraints. * @param handle - - * @param g - the valid MultiPolygon geometry to process * @param lengthRatio - specifies the Maximum Edge Length as a fraction of the difference between the longest and shortest edge lengths between the polygons. This normalizes the Maximum Edge Length to be scale-free. A value of 1 produces the convex hull; a value of 0 produces the original polygons. * @param isTight - is the concave hull allowed to contain holes? * @param isHolesAllowed - does the hull follow the outer boundaries of the input polygons. * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSConcaveHullOfPolygons_r(handle: GEOSContextHandle_t, g: GEOSGeometry, lengthRatio: number, isTight: number, isHolesAllowed: number): GEOSGeometry; /** * Return a constrained Delaunay triangulation of the vertices of the given polygon(s). For non-polygonal inputs, returns an empty geometry collection. * @param g - the input geometry whose rings will be used as input * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSConstrainedDelaunayTriangulation(g: GEOSGeometry): GEOSGeometry; /** * Return a constrained Delaunay triangulation of the vertices of the given polygon(s). For non-polygonal inputs, returns an empty geometry collection. * @param handle - - * @param g - the input geometry whose rings will be used as input * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSConstrainedDelaunayTriangulation_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * True if geometry g2 is completely within g1. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSContains(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometry g2 is completely within g1. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSContains_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Set the notice handler callback function for run-time error messages. * @param extHandle - the GEOS context from GEOS_init_r * @param ef - the handler callback * @returns GEOSMessageHandler - the previously configured message handler or NULL if no message handler was configured */ GEOSContext_setErrorHandler_r(extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler): GEOSMessageHandler; /** * Sets an error message handler on the given GEOS context. * @param extHandle - the GEOS context * @param ef - the message handler * @param userData - optional user data pointer that will be passed to the message handler * @returns GEOSMessageHandler_r - the previously configured message handler or NULL if no message handler was configured */ GEOSContext_setErrorMessageHandler_r(extHandle: GEOSContextHandle_t, ef: GEOSMessageHandler_r, userData: Pointer): GEOSMessageHandler_r; /** * Set the notice handler callback function for run-time notice messages. * @param extHandle - the context returned by GEOS_init_r. * @param nf - the handler callback * @returns GEOSMessageHandler - the previously configured message handler or NULL if no message handler was configured */ GEOSContext_setNoticeHandler_r(extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler): GEOSMessageHandler; /** * Sets a notice message handler on the given GEOS context. * @param extHandle - the GEOS context from GEOS_init_r * @param nf - the message handler * @param userData - optional user data pointer that will be passed to the message handler * @returns GEOSMessageHandler_r - the previously configured message handler or NULL if no message handler was configured */ GEOSContext_setNoticeMessageHandler_r(extHandle: GEOSContextHandle_t, nf: GEOSMessageHandler_r, userData: Pointer): GEOSMessageHandler_r; /** * Returns convex hull of a geometry. The smallest convex Geometry that contains all the points in the input Geometry * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the convex hull. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSConvexHull(g: GEOSGeometry): GEOSGeometry; /** * Returns convex hull of a geometry. The smallest convex Geometry that contains all the points in the input Geometry * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the convex hull. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSConvexHull_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Clone a coordinate sequence. * @param s - the coordinate sequence to clone * @returns GEOSCoordSequence - a copy of the coordinate sequence or NULL on exception */ GEOSCoordSeq_clone(s: GEOSCoordSequence): GEOSCoordSequence; /** * Clone a coordinate sequence. * @param handle - - * @param s - the coordinate sequence to clone * @returns GEOSCoordSequence - a copy of the coordinate sequence or NULL on exception */ GEOSCoordSeq_clone_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): GEOSCoordSequence; /** * Create a coordinate sequence by copying from arrays of doubles * @param x - array of x coordinates * @param y - array of y coordinates * @param z - array of z coordinates, or NULL * @param m - array of m coordinates, or NULL * @param size - length of each array * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_copyFromArrays(x: ArrayPointer, y: ArrayPointer, z: ArrayPointer, m: ArrayPointer, size: number): GEOSCoordSequence; /** * Create a coordinate sequence by copying from arrays of doubles * @param handle - - * @param x - array of x coordinates * @param y - array of y coordinates * @param z - array of z coordinates, or NULL * @param m - array of m coordinates, or NULL * @param size - length of each array * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_copyFromArrays_r(handle: GEOSContextHandle_t, x: ArrayPointer, y: ArrayPointer, z: ArrayPointer, m: ArrayPointer, size: number): GEOSCoordSequence; /** * Create a coordinate sequence by copying from an interleaved buffer of doubles (e.g., XYXY or XYZXYZ) * @param buf - pointer to buffer * @param size - number of coordinates in the sequence * @param hasZ - does buffer have Z values? * @param hasM - does buffer have M values? * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_copyFromBuffer(buf: NumberPointer, size: number, hasZ: number, hasM: number): GEOSCoordSequence; /** * Create a coordinate sequence by copying from an interleaved buffer of doubles (e.g., XYXY or XYZXYZ) * @param handle - - * @param buf - pointer to buffer * @param size - number of coordinates in the sequence * @param hasZ - does buffer have Z values? * @param hasM - does buffer have M values? * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_copyFromBuffer_r(handle: GEOSContextHandle_t, buf: NumberPointer, size: number, hasZ: number, hasM: number): GEOSCoordSequence; /** * Copy the contents of a coordinate sequence to arrays of doubles * @param s - sequence to copy * @param x - array to which x values should be copied * @param y - array to which y values should be copied * @param z - array to which z values should be copied, or NULL * @param m - array to which m values should be copied, or NULL * @returns number - 1 on success, 0 on error */ GEOSCoordSeq_copyToArrays(s: GEOSCoordSequence, x: ArrayPointer, y: ArrayPointer, z: ArrayPointer, m: ArrayPointer): number; /** * Copy the contents of a coordinate sequence to arrays of doubles * @param handle - - * @param s - sequence to copy * @param x - array to which x values should be copied * @param y - array to which y values should be copied * @param z - array to which z values should be copied, or NULL * @param m - array to which m values should be copied, or NULL * @returns number - 1 on success, 0 on error */ GEOSCoordSeq_copyToArrays_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, x: ArrayPointer, y: ArrayPointer, z: ArrayPointer, m: ArrayPointer): number; /** * Copy the contents of a coordinate sequence to an interleaved buffer of doubles (e.g., XYXY or XYZXYZ) * @param s - sequence to copy * @param buf - buffer to which coordinates should be copied * @param hasZ - copy Z values to buffer? * @param hasM - copy M values to buffer? * @returns number - 1 on success, 0 on error */ GEOSCoordSeq_copyToBuffer(s: GEOSCoordSequence, buf: NumberPointer, hasZ: number, hasM: number): number; /** * Copy the contents of a coordinate sequence to an interleaved buffer of doubles (e.g., XYXY or XYZXYZ) * @param handle - - * @param s - sequence to copy * @param buf - buffer to which coordinates should be copied * @param hasZ - copy Z values to buffer? * @param hasM - copy M values to buffer? * @returns number - 1 on success, 0 on error */ GEOSCoordSeq_copyToBuffer_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, buf: NumberPointer, hasZ: number, hasM: number): number; /** * Create a coordinate sequence. * @param size - number of coordinates in the sequence * @param dims - dimensionality of the coordinates (2, 3 or 4) * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_create(size: number, dims: number): GEOSCoordSequence; /** * Create a coordinate sequence. * @param handle - - * @param size - number of coordinates in the sequence * @param dims - dimensionality of the coordinates (2, 3 or 4) * @returns GEOSCoordSequence - the sequence or NULL on exception */ GEOSCoordSeq_create_r(handle: GEOSContextHandle_t, size: number, dims: number): GEOSCoordSequence; /** * Destroy a coordinate sequence, freeing all memory. * @param s - the coordinate sequence to destroy * @returns null - void */ GEOSCoordSeq_destroy(s: GEOSCoordSequence): null; /** * Destroy a coordinate sequence, freeing all memory. * @param handle - - * @param s - the coordinate sequence to destroy * @returns null - void */ GEOSCoordSeq_destroy_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): null; /** * Get dimension info from a coordinate sequence. * @param s - the coordinate sequence * @param dims - pointer where dimension value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getDimensions(s: GEOSCoordSequence, dims: NumberPointer): number; /** * Get dimension info from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param dims - pointer where dimension value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getDimensions_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, dims: NumberPointer): number; /** * Read Nth ordinate value from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param dim - the dimension number of the ordinate to read, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getOrdinate(s: GEOSCoordSequence, idx: number, dim: number, val: NumberPointer): number; /** * Read Nth ordinate value from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param dim - the dimension number of the ordinate to read, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getOrdinate_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, dim: number, val: NumberPointer): number; /** * Get size info from a coordinate sequence. * @param s - the coordinate sequence * @param size - pointer where size value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getSize(s: GEOSCoordSequence, size: NumberPointer): number; /** * Get size info from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param size - pointer where size value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getSize_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, size: NumberPointer): number; /** * Read X ordinate values from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getX(s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Read X ordinate values from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getX_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Read X and Y ordinate values from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - pointer where ordinate X value will be placed * @param y - pointer where ordinate Y value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getXY(s: GEOSCoordSequence, idx: number, x: NumberPointer, y: NumberPointer): number; /** * Read X and Y ordinate values from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - pointer where ordinate X value will be placed * @param y - pointer where ordinate Y value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getXY_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, x: NumberPointer, y: NumberPointer): number; /** * Read X and Y ordinate values from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - pointer where ordinate X value will be placed * @param y - pointer where ordinate Y value will be placed * @param z - pointer where ordinate Z value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getXYZ(s: GEOSCoordSequence, idx: number, x: NumberPointer, y: NumberPointer, z: NumberPointer): number; /** * Read X and Y ordinate values from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - pointer where ordinate X value will be placed * @param y - pointer where ordinate Y value will be placed * @param z - pointer where ordinate Z value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getXYZ_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, x: NumberPointer, y: NumberPointer, z: NumberPointer): number; /** * Read Y ordinate values from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getY(s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Read Y ordinate values from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getY_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Read Z ordinate values from a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getZ(s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Read Z ordinate values from a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - pointer where ordinate value will be placed * @returns number - 0 on exception */ GEOSCoordSeq_getZ_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: NumberPointer): number; /** * Check orientation of a coordinate sequence. Closure of the sequence is assumed. Invalid (collapsed) or short (fewer than 4 points) sequences return false. * @param s - the coordinate sequence * @param is_ccw - pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise * @returns number - 0 on exception, 1 on success */ GEOSCoordSeq_isCCW(s: GEOSCoordSequence, is_ccw: StringPointer): number; /** * Check orientation of a coordinate sequence. Closure of the sequence is assumed. Invalid (collapsed) or short (fewer than 4 points) sequences return false. * @param handle - - * @param s - the coordinate sequence * @param is_ccw - pointer for ccw value, 1 if counter-clockwise orientation, 0 otherwise * @returns number - 0 on exception, 1 on success */ GEOSCoordSeq_isCCW_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, is_ccw: StringPointer): number; /** * Set Nth ordinate value in a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param dim - the dimension number of the ordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setOrdinate(s: GEOSCoordSequence, idx: number, dim: number, val: number): number; /** * Set Nth ordinate value in a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param dim - the dimension number of the ordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setOrdinate_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, dim: number, val: number): number; /** * Set X ordinate values in a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setX(s: GEOSCoordSequence, idx: number, val: number): number; /** * Set X ordinate values in a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setX_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: number): number; /** * Set X and Y ordinate values in a coordinate sequence simultaneously. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - the value to set the X ordinate to * @param y - the value to set the Y ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setXY(s: GEOSCoordSequence, idx: number, x: number, y: number): number; /** * Set X and Y ordinate values in a coordinate sequence simultaneously. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - the value to set the X ordinate to * @param y - the value to set the Y ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setXY_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, x: number, y: number): number; /** * Set X, Y and Z ordinate values in a coordinate sequence simultaneously. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - the value to set the X ordinate to * @param y - the value to set the Y ordinate to * @param z - the value to set the Z ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setXYZ(s: GEOSCoordSequence, idx: number, x: number, y: number, z: number): number; /** * Set X, Y and Z ordinate values in a coordinate sequence simultaneously. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param x - the value to set the X ordinate to * @param y - the value to set the Y ordinate to * @param z - the value to set the Z ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setXYZ_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, x: number, y: number, z: number): number; /** * Set Y ordinate values in a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setY(s: GEOSCoordSequence, idx: number, val: number): number; /** * Set Y ordinate values in a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setY_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: number): number; /** * Set Z ordinate values in a coordinate sequence. * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setZ(s: GEOSCoordSequence, idx: number, val: number): number; /** * Set Z ordinate values in a coordinate sequence. * @param handle - - * @param s - the coordinate sequence * @param idx - the index of the coordinate to alter, zero based * @param val - the value to set the ordinate to * @returns number - 0 on exception */ GEOSCoordSeq_setZ_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence, idx: number, val: number): number; /** * Analyze a coverage (represented as a collection of polygonal geometry with exactly matching edge geometry) to find places where the assumption of exactly matching edges is not met. * @param input - The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON. * @param gapWidth - The maximum width of gaps to detect. * @param invalidEdges - When there are invalidities in the coverage, this pointer will be set with a geometry collection of the same length as the input, with a MULTILINESTRING of the error edges for each invalid polygon, or an EMPTY where the polygon is a valid participant in the coverage. Pass NULL if you do not want the invalid edges returned. * @returns number - A value of 1 for a valid coverage, 0 for invalid and 2 for an exception or error. Invalidity includes polygons that overlap, that have gaps smaller than the gapWidth, or non-polygonal entries in the input collection. */ GEOSCoverageIsValid(input: GEOSGeometry, gapWidth: number, invalidEdges: GEOSGeometry): number; /** * Analyze a coverage (represented as a collection of polygonal geometry with exactly matching edge geometry) to find places where the assumption of exactly matching edges is not met. * @param extHandle - - * @param input - The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON. * @param gapWidth - The maximum width of gaps to detect. * @param output - When there are invalidities in the coverage, this pointer will be set with a geometry collection of the same length as the input, with a MULTILINESTRING of the error edges for each invalid polygon, or an EMPTY where the polygon is a valid participant in the coverage. Pass NULL if you do not want the invalid edges returned. * @returns number - A value of 1 for a valid coverage, 0 for invalid and 2 for an exception or error. Invalidity includes polygons that overlap, that have gaps smaller than the gapWidth, or non-polygonal entries in the input collection. */ GEOSCoverageIsValid_r(extHandle: GEOSContextHandle_t, input: GEOSGeometry, gapWidth: number, output: GEOSGeometry): number; /** * Operates on a coverage (represented as a list of polygonal geometry with exactly matching edge geometry) to apply a Visvalingam–Whyatt simplification to the edges, reducing complexity in proportion with the provided tolerance, while retaining a valid coverage (no edges will cross or touch after the simplification). Geometries never disappear, but they may be simplified down to just a triangle. Also, some invalid geoms (such as Polygons which have too few non-repeated points) will be returned unchanged. If the input dataset is not a valid coverage due to overlaps, it will still be simplified, but invalid topology such as crossing edges will still be invalid. * @param input - The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON. * @param tolerance - A tolerance parameter in linear units. * @param preserveBoundary - Use 1 to preserve the outside edges of the coverage without simplification, 0 to allow them to be simplified. * @returns GEOSGeometry - A collection containing the simplified geometries, or null on error. */ GEOSCoverageSimplifyVW(input: GEOSGeometry, tolerance: number, preserveBoundary: number): GEOSGeometry; /** * Operates on a coverage (represented as a list of polygonal geometry with exactly matching edge geometry) to apply a Visvalingam–Whyatt simplification to the edges, reducing complexity in proportion with the provided tolerance, while retaining a valid coverage (no edges will cross or touch after the simplification). Geometries never disappear, but they may be simplified down to just a triangle. Also, some invalid geoms (such as Polygons which have too few non-repeated points) will be returned unchanged. If the input dataset is not a valid coverage due to overlaps, it will still be simplified, but invalid topology such as crossing edges will still be invalid. * @param extHandle - - * @param input - The polygonal coverage to access, stored in a geometry collection. All members must be POLYGON or MULTIPOLYGON. * @param tolerance - A tolerance parameter in linear units. * @param preserveBoundary - Use 1 to preserve the outside edges of the coverage without simplification, 0 to allow them to be simplified. * @returns GEOSGeometry - A collection containing the simplified geometries, or null on error. */ GEOSCoverageSimplifyVW_r(extHandle: GEOSContextHandle_t, input: GEOSGeometry, tolerance: number, preserveBoundary: number): GEOSGeometry; /** * Optimized union algorithm for polygonal inputs that are correctly noded and do not overlap. It may generate an error (return NULL) for inputs that do not satisfy this constraint, however this is not guaranteed. * @param g - The input geometry * @returns GEOSGeometry - A geometry that covers all the points of the input geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSCoverageUnion(g: GEOSGeometry): GEOSGeometry; /** * Optimized union algorithm for polygonal inputs that are correctly noded and do not overlap. It may generate an error (return NULL) for inputs that do not satisfy this constraint, however this is not guaranteed. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A geometry that covers all the points of the input geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSCoverageUnion_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * True if geometry g2 is completely within g1, including possibly touching the boundary of g1. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCoveredBy(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometry g2 is completely within g1, including possibly touching the boundary of g1. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCoveredBy_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometry g1 is completely within g2, including possibly touching the boundary of g2. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCovers(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometry g1 is completely within g2, including possibly touching the boundary of g2. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCovers_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries interiors interact but their boundaries do not. Most useful for finding line crosses cases. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCrosses(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries interiors interact but their boundaries do not. Most useful for finding line crosses cases. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSCrosses_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Return a Delaunay triangulation of the vertices of the given geometry. * @param g - the input geometry whose vertices will be used as "sites" * @param tolerance - optional snapping tolerance to use for improved robustness * @param onlyEdges - if non-zero will return a MultiLineString, otherwise it will return a GeometryCollection containing triangular Polygons. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDelaunayTriangulation(g: GEOSGeometry, tolerance: number, onlyEdges: number): GEOSGeometry; /** * Return a Delaunay triangulation of the vertices of the given geometry. * @param handle - - * @param g - the input geometry whose vertices will be used as "sites" * @param tolerance - optional snapping tolerance to use for improved robustness * @param onlyEdges - if non-zero will return a MultiLineString, otherwise it will return a GeometryCollection containing triangular Polygons. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDelaunayTriangulation_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number, onlyEdges: number): GEOSGeometry; /** * Densifies a geometry using a given distance tolerance. Additional vertices will be added to every line segment that is greater this tolerance; these vertices will evenly subdivide that segment. Only linear components of input geometry are densified. * @param g - The geometry to densify * @param tolerance - the distance tolerance to densify * @returns GEOSGeometry - The densified geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDensify(g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Densifies a geometry using a given distance tolerance. Additional vertices will be added to every line segment that is greater this tolerance; these vertices will evenly subdivide that segment. Only linear components of input geometry are densified. * @param handle - - * @param g - The geometry to densify * @param tolerance - the distance tolerance to densify * @returns GEOSGeometry - The densified geometry, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDensify_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Returns the difference of two geometries A and B: the set of points that fall within A but not within B. * @param ga - the base geometry * @param gb - the geometry to subtract from it * @returns GEOSGeometry - A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDifference(ga: GEOSGeometry, gb: GEOSGeometry): GEOSGeometry; /** * Returns the difference of two geometries A and B: the set of points that fall within A but not within B. * @param handle - - * @param g1 - the base geometry * @param g2 - the geometry to subtract from it * @returns GEOSGeometry - A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDifference_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Returns the difference of two geometries A and B: the set of points that fall within A but not within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param ga - one of the geometries * @param gb - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDifferencePrec(ga: GEOSGeometry, gb: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the difference of two geometries A and B: the set of points that fall within A but not within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param handle - - * @param g1 - one of the geometries * @param g2 - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDifferencePrec_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, gridSize: number): GEOSGeometry; /** * True if no point of either geometry touchess or is within the other. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSDisjoint(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if no point of either geometry touchess or is within the other. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSDisjoint_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Optimized union algorithm for inputs that can be divided into subsets that do not intersect. If there is only one such subset, performance can be expected to be worse than GEOSUnionaryUnion. * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the union, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDisjointSubsetUnion(g: GEOSGeometry): GEOSGeometry; /** * Optimized union algorithm for inputs that can be divided into subsets that do not intersect. If there is only one such subset, performance can be expected to be worse than GEOSUnionaryUnion. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the union, or NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSDisjointSubsetUnion_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Calculate the distance between two geometries. * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSDistance(g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the distance between two geometries. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSDistance_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the distance between two geometries, using the indexed facet distance, which first indexes the geometries internally, then calculates the distance. Useful when one or both geometries is very large. * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSDistanceIndexed(g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the distance between two geometries, using the indexed facet distance, which first indexes the geometries internally, then calculates the distance. Useful when one or both geometries is very large. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSDistanceIndexed_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Test whether the distance between two geometries is within the given dist. * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - The max distance * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSDistanceWithin(g1: GEOSGeometry, g2: GEOSGeometry, dist: number): number; /** * Test whether the distance between two geometries is within the given dist. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - The max distance * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSDistanceWithin_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, dist: number): number; /** * Returns minimum rectangular polygon or point that contains the geometry, or an empty point for empty inputs. * @param g - The geometry to calculate an envelope for * @returns GEOSGeometry - A newly allocated polygonal envelope or point. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSEnvelope(g: GEOSGeometry): GEOSGeometry; /** * Returns minimum rectangular polygon or point that contains the geometry, or an empty point for empty inputs. * @param handle - - * @param g - The geometry to calculate an envelope for * @returns GEOSGeometry - A newly allocated polygonal envelope or point. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSEnvelope_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * True if geometries cover the same space on the plane. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEquals(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries cover the same space on the plane. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEquals_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Determine pointwise equivalence of two geometries, by checking that they have identical structure and that each vertex of g2 is within the distance tolerance of the corresponding vertex in g1. Z and M values are ignored by GEOSEqualsExact, and this function may return true for inputs with different dimensionality. Unlike GEOSEquals(), geometries that are topologically equivalent but have different representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not considered equal by GEOSEqualsExact(). * @param g1 - Input geometry * @param g2 - Input geometry * @param tolerance - Tolerance to determine vertex equality * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEqualsExact(g1: GEOSGeometry, g2: GEOSGeometry, tolerance: number): number; /** * Determine pointwise equivalence of two geometries, by checking that they have identical structure and that each vertex of g2 is within the distance tolerance of the corresponding vertex in g1. Z and M values are ignored by GEOSEqualsExact, and this function may return true for inputs with different dimensionality. Unlike GEOSEquals(), geometries that are topologically equivalent but have different representations (e.g., LINESTRING (0 0, 1 1) and MULTILINESTRING ((0 0, 1 1)) ) are not considered equal by GEOSEqualsExact(). * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param tolerance - Tolerance to determine vertex equality * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEqualsExact_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, tolerance: number): number; /** * Determine pointwise equivalence of two geometries by checking that the structure, ordering, and values of all vertices are identical in all dimensions. NaN values are considered to be equal to other NaN values. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEqualsIdentical(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Determine pointwise equivalence of two geometries by checking that the structure, ordering, and values of all vertices are identical in all dimensions. NaN values are considered to be equal to other NaN values. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSEqualsIdentical_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Calculate the Frechet distance between two geometries, a similarity measure for linear features. * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSFrechetDistance(g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the Frechet distance between two geometries, a similarity measure for linear features. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSFrechetDistance_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the Frechet distance between two geometries, a similarity measure for linear features. The inputs can be densified to provide a more accurate result. * @param g1 - Input geometry * @param g2 - Input geometry * @param densifyFrac - The largest % of the overall line length that any given two-point segment should be * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSFrechetDistanceDensify(g1: GEOSGeometry, g2: GEOSGeometry, densifyFrac: number, dist: NumberPointer): number; /** * Calculate the Frechet distance between two geometries, a similarity measure for linear features. The inputs can be densified to provide a more accurate result. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param densifyFrac - The largest % of the overall line length that any given two-point segment should be * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSFrechetDistanceDensify_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, densifyFrac: number, dist: NumberPointer): number; /** * Free strings and byte buffers returned by functions such as GEOSWKBWriter_write(), GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc. If passed a null pointer the function does nothing. * @param buffer - The memory to free (may be null) * @returns null - void */ GEOSFree(buffer: Pointer): null; /** * Free strings and byte buffers returned by functions such as GEOSWKBWriter_write(), GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write(), etc. If passed a null pointer the function does nothing. * @param handle - - * @param buffer - The memory to free (may be null) * @returns null - void */ GEOSFree_r(handle: GEOSContextHandle_t, buffer: Pointer): null; /** * Allocate a new GEOSGeoJSONReader. * @returns GEOSGeoJSONReader - a new reader. Caller must free with GEOSGeoJSONReader_destroy() */ GEOSGeoJSONReader_create(): GEOSGeoJSONReader; /** * Allocate a new GEOSGeoJSONReader. * @param handle - - * @returns GEOSGeoJSONReader - a new reader. Caller must free with GEOSGeoJSONReader_destroy() */ GEOSGeoJSONReader_create_r(handle: GEOSContextHandle_t): GEOSGeoJSONReader; /** * Free the memory associated with a GEOSGeoJSONReader. * @param reader - The reader to destroy. * @returns null - void */ GEOSGeoJSONReader_destroy(reader: GEOSGeoJSONReader): null; /** * Free the memory associated with a GEOSGeoJSONReader. * @param handle - - * @param reader - The reader to destroy. * @returns null - void */ GEOSGeoJSONReader_destroy_r(handle: GEOSContextHandle_t, reader: GEOSGeoJSONReader): null; /** * Use a reader to parse a GeoJSON string. A single geometry or Feature is parsed as a geometry. A FeatureCollection is parsed as a GeometryCollection. Feature properties are not read. * @param reader - A GeoJSON reader object, caller retains ownership * @param geojson - The json string to parse, caller retains ownership * @returns GEOSGeometry - A GEOSGeometry, caller to free with GEOSGeom_destroy()) */ GEOSGeoJSONReader_readGeometry(reader: GEOSGeoJSONReader, geojson: StringPointer): GEOSGeometry; /** * @param handle - - * @param reader - - * @param geojson - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeoJSONReader_readGeometry_r(handle: GEOSContextHandle_t, reader: GEOSGeoJSONReader, geojson: StringPointer): GEOSGeometry; /** * Allocate a new GEOSGeoJSONWriter. * @returns GEOSGeoJSONWriter - a new writer. Caller must free with GEOSGeoJSONWriter_destroy() */ GEOSGeoJSONWriter_create(): GEOSGeoJSONWriter; /** * Allocate a new GEOSGeoJSONWriter. * @param handle - - * @returns GEOSGeoJSONWriter - a new writer. Caller must free with GEOSGeoJSONWriter_destroy() */ GEOSGeoJSONWriter_create_r(handle: GEOSContextHandle_t): GEOSGeoJSONWriter; /** * Free the memory associated with a GEOSGeoJSONWriter. * @param writer - The writer to destroy. * @returns null - void */ GEOSGeoJSONWriter_destroy(writer: GEOSGeoJSONWriter): null; /** * Free the memory associated with a GEOSGeoJSONWriter. * @param handle - - * @param writer - The writer to destroy. * @returns null - void */ GEOSGeoJSONWriter_destroy_r(handle: GEOSContextHandle_t, writer: GEOSGeoJSONWriter): null; /** * Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON Feature or FeatureCollection is unsupported through the GEOS C API. * @param writer - A GeoJSON reader object, caller retains ownership. * @param g - The geometry to convert, caller retains ownership. * @param indent - The indentation used. Use -1 for no formatting. * @returns StringPointer - A char pointer, caller to free with GEOSFree()) */ GEOSGeoJSONWriter_writeGeometry(writer: GEOSGeoJSONWriter, g: GEOSGeometry, indent: number): StringPointer; /** * Write out the GeoJSON representation of a geometry. Note that writing a GeoJSON Feature or FeatureCollection is unsupported through the GEOS C API. * @param handle - - * @param writer - A GeoJSON reader object, caller retains ownership. * @param g - The geometry to convert, caller retains ownership. * @param indent - The indentation used. Use -1 for no formatting. * @returns StringPointer - A char pointer, caller to free with GEOSFree()) */ GEOSGeoJSONWriter_writeGeometry_r(handle: GEOSContextHandle_t, writer: GEOSGeoJSONWriter, g: GEOSGeometry, indent: number): StringPointer; /** * Create a new copy of the input geometry. * @param g - The geometry to copy * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_clone(g: GEOSGeometry): GEOSGeometry; /** * Create a new copy of the input geometry. * @param handle - - * @param g - The geometry to copy * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_clone_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Creates a CircularString geometry. * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCircularString(s: GEOSCoordSequence): GEOSGeometry; /** * Creates a CircularString geometry. * @param handle - - * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCircularString_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): GEOSGeometry; /** * Create a geometry collection. * @param type - The geometry type, enumerated by GEOSGeomTypes * @param geoms - A list of geometries that will form the collection * @param ngeoms - The number of geometries in the geoms list * @returns GEOSGeometry - A newly allocated geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCollection(type: number, geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Create a geometry collection. * @param handle - - * @param type - The geometry type, enumerated by GEOSGeomTypes * @param geoms - A list of geometries that will form the collection * @param ngeoms - The number of geometries in the geoms list * @returns GEOSGeometry - A newly allocated geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCollection_r(handle: GEOSContextHandle_t, type: number, geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Creates a CompoundCurve geometry. * @param curves - A list of geometries that will form the CompoundCurve * @param ncurves - The number of geometries in the curves list * @returns GEOSGeometry - A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCompoundCurve(curves: GEOSGeometry, ncurves: number): GEOSGeometry; /** * Creates a CompoundCurve geometry. * @param handle - - * @param curves - A list of geometries that will form the CompoundCurve * @param ncurves - The number of geometries in the curves list * @returns GEOSGeometry - A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCompoundCurve_r(handle: GEOSContextHandle_t, curves: GEOSGeometry, ncurves: number): GEOSGeometry; /** * Creates a CurvePolygon geometry from ring geometries. * @param shell - A ring that is the exterior ring of the polygon. * @param holes - An array of rings that are the holes. * @param nholes - The number of rings in the holes array. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCurvePolygon(shell: GEOSGeometry, holes: GEOSGeometry, nholes: number): GEOSGeometry; /** * Creates a CurvePolygon geometry from ring geometries. * @param handle - - * @param shell - A ring that is the exterior ring of the polygon. * @param holes - An array of rings that are the holes. * @param nholes - The number of rings in the holes array. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createCurvePolygon_r(handle: GEOSContextHandle_t, shell: GEOSGeometry, holes: GEOSGeometry, nholes: number): GEOSGeometry; /** * Creates an empty CircularString geometry. * @returns GEOSGeometry - A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCircularString(): GEOSGeometry; /** * Creates an empty CircularString geometry. * @param handle - - * @returns GEOSGeometry - A newly allocated CircularString geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCircularString_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Create an empty geometry collection. * @param type - The geometry type, enumerated by GEOSGeomTypes * @returns GEOSGeometry - A newly allocated empty geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCollection(type: number): GEOSGeometry; /** * Create an empty geometry collection. * @param handle - - * @param type - The geometry type, enumerated by GEOSGeomTypes * @returns GEOSGeometry - A newly allocated empty geometry collection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCollection_r(handle: GEOSContextHandle_t, type: number): GEOSGeometry; /** * Creates an empty CompoundCurve geometry. * @returns GEOSGeometry - A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCompoundCurve(): GEOSGeometry; /** * Creates an empty CompoundCurve geometry. * @param handle - - * @returns GEOSGeometry - A newly allocated CompoundCurve geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCompoundCurve_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Creates an empty CurvePolygon geometry. * @returns GEOSGeometry - A newly allocated CurvePolygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCurvePolygon(): GEOSGeometry; /** * Creates an empty CurvePolygon geometry. * @param handle - - * @returns GEOSGeometry - A newly allocated CurvePolygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyCurvePolygon_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Creates an emptylinestring geometry. * @returns GEOSGeometry - A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyLineString(): GEOSGeometry; /** * Creates an emptylinestring geometry. * @param handle - - * @returns GEOSGeometry - A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyLineString_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Creates an empty point. * @returns GEOSGeometry - A newly allocated empty point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyPoint(): GEOSGeometry; /** * Creates an empty point. * @param handle - - * @returns GEOSGeometry - A newly allocated empty point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyPoint_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Creates an empty polygon geometry. * @returns GEOSGeometry - A newly allocated empty polygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyPolygon(): GEOSGeometry; /** * Creates an empty polygon geometry. * @param handle - - * @returns GEOSGeometry - A newly allocated empty polygon geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createEmptyPolygon_r(handle: GEOSContextHandle_t): GEOSGeometry; /** * Creates a linear ring geometry, for use in a polygon. * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated linear ring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createLinearRing(s: GEOSCoordSequence): GEOSGeometry; /** * Creates a linear ring geometry, for use in a polygon. * @param handle - - * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated linear ring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createLinearRing_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): GEOSGeometry; /** * Creates a linestring geometry. * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createLineString(s: GEOSCoordSequence): GEOSGeometry; /** * Creates a linestring geometry. * @param handle - - * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated linestring geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createLineString_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): GEOSGeometry; /** * Creates a point geometry from a coordinate sequence. * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPoint(s: GEOSCoordSequence): GEOSGeometry; /** * Creates a point geometry from a coordinate sequence. * @param handle - - * @param s - Input coordinate sequence, ownership passes to the geometry * @returns GEOSGeometry - A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPoint_r(handle: GEOSContextHandle_t, s: GEOSCoordSequence): GEOSGeometry; /** * Creates a point geometry from a pair of coordinates. * @param x - The X coordinate * @param y - The Y coordinate * @returns GEOSGeometry - A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPointFromXY(x: number, y: number): GEOSGeometry; /** * Creates a point geometry from a pair of coordinates. * @param handle - - * @param x - The X coordinate * @param y - The Y coordinate * @returns GEOSGeometry - A newly allocated point geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPointFromXY_r(handle: GEOSContextHandle_t, x: number, y: number): GEOSGeometry; /** * Creates a polygon geometry from linear ring geometries. * @param shell - A linear ring that is the exterior ring of the polygon. * @param holes - An array of linear rings that are the holes. * @param nholes - The number of rings in the holes array. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPolygon(shell: GEOSGeometry, holes: GEOSGeometry, nholes: number): GEOSGeometry; /** * Creates a polygon geometry from linear ring geometries. * @param handle - - * @param shell - A linear ring that is the exterior ring of the polygon. * @param holes - An array of linear rings that are the holes. * @param nholes - The number of rings in the holes array. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_createPolygon_r(handle: GEOSContextHandle_t, shell: GEOSGeometry, holes: GEOSGeometry, nholes: number): GEOSGeometry; /** * Create a rectangular polygon from bounding coordinates. Will return a point geometry if width and height are 0. * @param xmin - Left bound of envelope * @param ymin - Lower bound of envelope * @param xmax - Right bound of envelope * @param ymax - Upper bound of envelope * @returns GEOSGeometry - GEOSGeometry */ GEOSGeom_createRectangle(xmin: number, ymin: number, xmax: number, ymax: number): GEOSGeometry; /** * Create a rectangular polygon from bounding coordinates. Will return a point geometry if width and height are 0. * @param handle - - * @param xmin - Left bound of envelope * @param ymin - Lower bound of envelope * @param xmax - Right bound of envelope * @param ymax - Upper bound of envelope * @returns GEOSGeometry - GEOSGeometry */ GEOSGeom_createRectangle_r(handle: GEOSContextHandle_t, xmin: number, ymin: number, xmax: number, ymax: number): GEOSGeometry; /** * Release the memory associated with a geometry. * @param g - The geometry to be destroyed. * @returns null - void */ GEOSGeom_destroy(g: GEOSGeometry): null; /** * Release the memory associated with a geometry. * @param handle - - * @param g - The geometry to be destroyed. * @returns null - void */ GEOSGeom_destroy_r(handle: GEOSContextHandle_t, g: GEOSGeometry): null; /** * Return all distinct vertices of input geometry as a MultiPoint. Note that only 2 dimensions of the vertices are considered when testing for equality. * @param g - The input geometry * @returns GEOSGeometry - The distinct points Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_extractUniquePoints(g: GEOSGeometry): GEOSGeometry; /** * Return all distinct vertices of input geometry as a MultiPoint. Note that only 2 dimensions of the vertices are considered when testing for equality. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - The distinct points Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGeom_extractUniquePoints_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Return the cartesian dimension of the geometry. * @param g - Input geometry * @returns number - The dimension */ GEOSGeom_getCoordinateDimension(g: GEOSGeometry): number; /** * Return the cartesian dimension of the geometry. * @param handle - - * @param g - Input geometry * @returns number - The dimension */ GEOSGeom_getCoordinateDimension_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Return the coordinate sequence underlying the given geometry (Must be a LineString, LinearRing or Point). Do not directly free the coordinate sequence, it is owned by the parent geometry. * @param g - Input geometry * @returns GEOSCoordSequence - Coordinate sequence or NULL on exception. */ GEOSGeom_getCoordSeq(g: GEOSGeometry): GEOSCoordSequence; /** * Return the coordinate sequence underlying the given geometry (Must be a LineString, LinearRing or Point). Do not directly free the coordinate sequence, it is owned by the parent geometry. * @param handle - - * @param g - Input geometry * @returns GEOSCoordSequence - Coordinate sequence or NULL on exception. */ GEOSGeom_getCoordSeq_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSCoordSequence; /** * Return the planar dimensionality of the geometry. * @param g - Input geometry * @returns number - The dimensionality */ GEOSGeom_getDimensions(g: GEOSGeometry): number; /** * Return the planar dimensionality of the geometry. * @param handle - - * @param g - Input geometry * @returns number - The dimensionality */ GEOSGeom_getDimensions_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Finds the extent (minimum and maximum X and Y value) of the geometry. Raises an exception for empty geometry input. * @param g - Input geometry * @param xmin - Pointer to place result for minimum X value * @param ymin - Pointer to place result for minimum Y value * @param xmax - Pointer to place result for maximum X value * @param ymax - Pointer to place result for maximum Y value * @returns number - 1 on success, 0 on exception */ GEOSGeom_getExtent(g: GEOSGeometry, xmin: NumberPointer, ymin: NumberPointer, xmax: NumberPointer, ymax: NumberPointer): number; /** * Finds the extent (minimum and maximum X and Y value) of the geometry. Raises an exception for empty geometry input. * @param handle - - * @param g - Input geometry * @param xmin - Pointer to place result for minimum X value * @param ymin - Pointer to place result for minimum Y value * @param xmax - Pointer to place result for maximum X value * @param ymax - Pointer to place result for maximum Y value * @returns number - 1 on success, 0 on exception */ GEOSGeom_getExtent_r(handle: GEOSContextHandle_t, g: GEOSGeometry, xmin: NumberPointer, ymin: NumberPointer, xmax: NumberPointer, ymax: NumberPointer): number; /** * Read the currently set precision value from the geometry and returns the grid size if it is a fixed precision or 0.0 if it is full floating point precision. * @param g - Input geometry * @returns number - The grid size, or -1 on exception */ GEOSGeom_getPrecision(g: GEOSGeometry): number; /** * Read the currently set precision value from the geometry and returns the grid size if it is a fixed precision or 0.0 if it is full floating point precision. * @param handle - - * @param g - Input geometry * @returns number - The grid size, or -1 on exception */ GEOSGeom_getPrecision_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Return the anonymous "user data" for this geometry. User data must be managed by the caller, and is not freed when the geometry is destroyed. * @param g - Input geometry * @returns Pointer - A void* to the user data, caller is responsible for casting to the appropriate type. */ GEOSGeom_getUserData(g: GEOSGeometry): Pointer; /** * Return the anonymous "user data" for this geometry. User data must be managed by the caller, and is not freed when the geometry is destroyed. * @param handle - - * @param g - Input geometry * @returns Pointer - A void* to the user data, caller is responsible for casting to the appropriate type. */ GEOSGeom_getUserData_r(handle: GEOSContextHandle_t, g: GEOSGeometry): Pointer; /** * Finds the maximum X value in the geometry. * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getXMax(g: GEOSGeometry, value: NumberPointer): number; /** * Finds the maximum X value in the geometry. * @param handle - - * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getXMax_r(handle: GEOSContextHandle_t, g: GEOSGeometry, value: NumberPointer): number; /** * Finds the minimum X value in the geometry. * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getXMin(g: GEOSGeometry, value: NumberPointer): number; /** * Finds the minimum X value in the geometry. * @param handle - - * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getXMin_r(handle: GEOSContextHandle_t, g: GEOSGeometry, value: NumberPointer): number; /** * Finds the maximum Y value in the geometry. * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getYMax(g: GEOSGeometry, value: NumberPointer): number; /** * Finds the maximum Y value in the geometry. * @param handle - - * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getYMax_r(handle: GEOSContextHandle_t, g: GEOSGeometry, value: NumberPointer): number; /** * Finds the minimum Y value in the geometry. * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getYMin(g: GEOSGeometry, value: NumberPointer): number; /** * Finds the minimum Y value in the geometry. * @param handle - - * @param g - Input geometry * @param value - Pointer to place result * @returns number - 0 on exception */ GEOSGeom_getYMin_r(handle: GEOSContextHandle_t, g: GEOSGeometry, value: NumberPointer): number; /** * Release the sub-geometries of a collection for management. by the caller. The input collection remains as an empty collection, that the caller is responsible for destroying. The output geometries are also the responsibility of the caller, as is the containing array, which must be freed with GEOSFree(). * @param collection - The collection that will have its components released. * @param ngeoms - A pointer to a variable that will be filled with the size of the output array. * @returns GEOSGeometry - A newly allocated array of GEOSGeometry pointers. */ GEOSGeom_releaseCollection(collection: GEOSGeometry, ngeoms: NumberPointer): GEOSGeometry; /** * Release the sub-geometries of a collection for management. by the caller. The input collection remains as an empty collection, that the caller is responsible for destroying. The output geometries are also the responsibility of the caller, as is the containing array, which must be freed with GEOSFree(). * @param handle - - * @param collection - The collection that will have its components released. * @param ngeoms - A pointer to a variable that will be filled with the size of the output array. * @returns GEOSGeometry - A newly allocated array of GEOSGeometry pointers. */ GEOSGeom_releaseCollection_r(handle: GEOSContextHandle_t, collection: GEOSGeometry, ngeoms: NumberPointer): GEOSGeometry; /** * Change the coordinate precision of a geometry. This will affect the precision of the existing geometry as well as any geometries derived from this geometry using overlay functions. The output will be a valid GEOSGeometry. * @param g - Input geometry * @param gridSize - cell size of grid to round coordinates to, or 0 for FLOATING precision * @param flags - The bitwise OR of members of the GEOSPrecisionRules enum * @returns GEOSGeometry - The precision reduced result. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeom_setPrecision(g: GEOSGeometry, gridSize: number, flags: number): GEOSGeometry; /** * Change the coordinate precision of a geometry. This will affect the precision of the existing geometry as well as any geometries derived from this geometry using overlay functions. The output will be a valid GEOSGeometry. * @param handle - - * @param g - Input geometry * @param gridSize - cell size of grid to round coordinates to, or 0 for FLOATING precision * @param flags - The bitwise OR of members of the GEOSPrecisionRules enum * @returns GEOSGeometry - The precision reduced result. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeom_setPrecision_r(handle: GEOSContextHandle_t, g: GEOSGeometry, gridSize: number, flags: number): GEOSGeometry; /** * Set the anonymous "user data" for this geometry. * @param g - Input geometry * @param userData - Void pointer to user data * @returns null - void */ GEOSGeom_setUserData(g: GEOSGeometry, userData: Pointer): null; /** * Set the anonymous "user data" for this geometry. * @param handle - - * @param g - Input geometry * @param userData - Void pointer to user data * @returns null - void */ GEOSGeom_setUserData_r(handle: GEOSContextHandle_t, g: GEOSGeometry, userData: Pointer): null; /** * Apply XY coordinate transform callback to all coordinates in a copy of input geometry. If the callback returns an error, returned geometry will be NULL. Z values, if present, are not modified by this function. * @param g - Input geometry * @param callback - a function to be executed for each coordinate in the geometry. The callback takes 3 parameters: x and y coordinate values to be updated and a void userdata pointer. * @param userdata - an optional pointer to pe passed to 'callback' as an argument * @returns GEOSGeometry - a copy of the input geometry with transformed coordinates. Caller must free with GEOSGeom_destroy(). */ GEOSGeom_transformXY(g: GEOSGeometry, callback: GEOSTransformXYCallback, userdata: Pointer): GEOSGeometry; /** * Apply XY coordinate transform callback to all coordinates in a copy of input geometry. If the callback returns an error, returned geometry will be NULL. Z values, if present, are not modified by this function. * @param handle - - * @param g - Input geometry * @param callback - a function to be executed for each coordinate in the geometry. The callback takes 3 parameters: x and y coordinate values to be updated and a void userdata pointer. * @param userdata - an optional pointer to pe passed to 'callback' as an argument * @returns GEOSGeometry - a copy of the input geometry with transformed coordinates. Caller must free with GEOSGeom_destroy(). */ GEOSGeom_transformXY_r(handle: GEOSContextHandle_t, g: GEOSGeometry, callback: GEOSTransformXYCallback, userdata: Pointer): GEOSGeometry; /** * @param hex - - * @param size - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromHEX_buf(hex: Pointer, size: number): GEOSGeometry; /** * @param handle - - * @param hex - - * @param size - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromHEX_buf_r(handle: GEOSContextHandle_t, hex: Pointer, size: number): GEOSGeometry; /** * @param wkb - - * @param size - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromWKB_buf(wkb: Pointer, size: number): GEOSGeometry; /** * @param handle - - * @param wkb - - * @param size - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromWKB_buf_r(handle: GEOSContextHandle_t, wkb: Pointer, size: number): GEOSGeometry; /** * @param wkt - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromWKT(wkt: StringPointer): GEOSGeometry; /** * @param handle - - * @param wkt - - * @returns GEOSGeometry - GEOSGeometry */ GEOSGeomFromWKT_r(handle: GEOSContextHandle_t, wkt: StringPointer): GEOSGeometry; /** * Return the last point of a LineString * @param g - Input geometry, must be a LineString * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetEndPoint(g: GEOSGeometry): GEOSGeometry; /** * Return the last point of a LineString * @param handle - - * @param g - Input geometry, must be a LineString * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetEndPoint_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Calculate the length of a LineString. Only works for LineString inputs, returns exception otherwise. * @param g - Input geometry * @param length - Pointer to be filled in with length result * @returns number - 1 on success, 0 on exception. */ GEOSGeomGetLength(g: GEOSGeometry, length: NumberPointer): number; /** * Calculate the length of a LineString. Only works for LineString inputs, returns exception otherwise. * @param handle - - * @param g - Input geometry * @param length - Pointer to be filled in with length result * @returns number - 1 on success, 0 on exception. */ GEOSGeomGetLength_r(handle: GEOSContextHandle_t, g: GEOSGeometry, length: NumberPointer): number; /** * Returns the M coordinate, for a Point input, or an exception otherwise. * @param g - Input Point geometry * @param m - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetM(g: GEOSGeometry, m: NumberPointer): number; /** * Returns the M coordinate, for a Point input, or an exception otherwise. * @param handle - - * @param g - Input Point geometry * @param m - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetM_r(handle: GEOSContextHandle_t, g: GEOSGeometry, m: NumberPointer): number; /** * Returns the number of points, for a LineString input, or an exception otherwise. * @param g - Input LineString geometry * @returns number - Number of points, -1 on exception */ GEOSGeomGetNumPoints(g: GEOSGeometry): number; /** * Returns the number of points, for a LineString input, or an exception otherwise. * @param handle - - * @param g - Input LineString geometry * @returns number - Number of points, -1 on exception */ GEOSGeomGetNumPoints_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Return the N'th point of a LineString * @param g - Input geometry, must be a LineString * @param n - Index of desired point (zero based) * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetPointN(g: GEOSGeometry, n: number): GEOSGeometry; /** * Return the N'th point of a LineString * @param handle - - * @param g - Input geometry, must be a LineString * @param n - Index of desired point (zero based) * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetPointN_r(handle: GEOSContextHandle_t, g: GEOSGeometry, n: number): GEOSGeometry; /** * Return the first point of a LineString * @param g - Input geometry, must be a LineString * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetStartPoint(g: GEOSGeometry): GEOSGeometry; /** * Return the first point of a LineString * @param handle - - * @param g - Input geometry, must be a LineString * @returns GEOSGeometry - A Point geometry. Caller must free with GEOSGeom_destroy() NULL on exception. */ GEOSGeomGetStartPoint_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns the X coordinate, for a Point input, or an exception otherwise. * @param g - Input Point geometry * @param x - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetX(g: GEOSGeometry, x: NumberPointer): number; /** * Returns the X coordinate, for a Point input, or an exception otherwise. * @param handle - - * @param g - Input Point geometry * @param x - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetX_r(handle: GEOSContextHandle_t, g: GEOSGeometry, x: NumberPointer): number; /** * Returns the Y coordinate, for a Point input, or an exception otherwise. * @param g - Input Point geometry * @param y - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetY(g: GEOSGeometry, y: NumberPointer): number; /** * Returns the Y coordinate, for a Point input, or an exception otherwise. * @param handle - - * @param g - Input Point geometry * @param y - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetY_r(handle: GEOSContextHandle_t, g: GEOSGeometry, y: NumberPointer): number; /** * Returns the Z coordinate, for a Point input, or an exception otherwise. * @param g - Input Point geometry * @param z - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetZ(g: GEOSGeometry, z: NumberPointer): number; /** * Returns the Z coordinate, for a Point input, or an exception otherwise. * @param handle - - * @param g - Input Point geometry * @param z - Pointer to hold return value * @returns number - 1 on success, 0 on exception */ GEOSGeomGetZ_r(handle: GEOSContextHandle_t, g: GEOSGeometry, z: NumberPointer): number; /** * @param g - - * @param size - - * @returns StringPointer - unsigned char * */ GEOSGeomToHEX_buf(g: GEOSGeometry, size: NumberPointer): StringPointer; /** * @param handle - - * @param g - - * @param size - - * @returns StringPointer - unsigned char * */ GEOSGeomToHEX_buf_r(handle: GEOSContextHandle_t, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * @param g - - * @param size - - * @returns StringPointer - unsigned char * */ GEOSGeomToWKB_buf(g: GEOSGeometry, size: NumberPointer): StringPointer; /** * @param handle - - * @param g - - * @param size - - * @returns StringPointer - unsigned char * */ GEOSGeomToWKB_buf_r(handle: GEOSContextHandle_t, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * @param g - - * @returns StringPointer - char * */ GEOSGeomToWKT(g: GEOSGeometry): StringPointer; /** * @param handle - - * @param g - - * @returns StringPointer - char * */ GEOSGeomToWKT_r(handle: GEOSContextHandle_t, g: GEOSGeometry): StringPointer; /** * Returns the geometry type string for this geometry. eg: "GeometryCollection", "LineString" * @param g - Input geometry * @returns StringPointer - A string with the geometry type. Caller must free with GEOSFree(). NULL on exception. */ GEOSGeomType(g: GEOSGeometry): StringPointer; /** * Returns the geometry type string for this geometry. eg: "GeometryCollection", "LineString" * @param handle - - * @param g - Input geometry * @returns StringPointer - A string with the geometry type. Caller must free with GEOSFree(). NULL on exception. */ GEOSGeomType_r(handle: GEOSContextHandle_t, g: GEOSGeometry): StringPointer; /** * Returns the GEOSGeomTypeId number for this geometry. * @param g - Input geometry * @returns number - The geometry type number, or -1 on exception. */ GEOSGeomTypeId(g: GEOSGeometry): number; /** * Returns the GEOSGeomTypeId number for this geometry. * @param handle - - * @param g - Input geometry * @returns number - The geometry type number, or -1 on exception. */ GEOSGeomTypeId_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Returns a point at the center of mass of the input. * @param g - The input geometry * @returns GEOSGeometry - A point at the center of mass of the input Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGetCentroid(g: GEOSGeometry): GEOSGeometry; /** * Returns a point at the center of mass of the input. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A point at the center of mass of the input Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSGetCentroid_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Get the external ring of a Polygon. * @param g - Input Polygon geometry * @returns GEOSGeometry - LinearRing geometry. Owned by parent geometry, do not free. NULL on exception. */ GEOSGetExteriorRing(g: GEOSGeometry): GEOSGeometry; /** * Get the external ring of a Polygon. * @param handle - - * @param g - Input Polygon geometry * @returns GEOSGeometry - LinearRing geometry. Owned by parent geometry, do not free. NULL on exception. */ GEOSGetExteriorRing_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns the specified sub-geometry of a collection. For a simple geometry, returns a pointer to the input. Returned object is a pointer to internal storage: it must NOT be destroyed directly. * @param g - Input geometry * @param n - Sub-geometry index, zero-based * @returns GEOSGeometry - A const GEOSGeometry, do not free! It will be freed when the parent is freed. Returns NULL on exception. */ GEOSGetGeometryN(g: GEOSGeometry, n: number): GEOSGeometry; /** * Returns the specified sub-geometry of a collection. For a simple geometry, returns a pointer to the input. Returned object is a pointer to internal storage: it must NOT be destroyed directly. * @param handle - - * @param g - Input geometry * @param n - Sub-geometry index, zero-based * @returns GEOSGeometry - A const GEOSGeometry, do not free! It will be freed when the parent is freed. Returns NULL on exception. */ GEOSGetGeometryN_r(handle: GEOSContextHandle_t, g: GEOSGeometry, n: number): GEOSGeometry; /** * Returns the N'th ring for a Polygon input. * @param g - Input Polygon geometry * @param n - Index of the desired ring * @returns GEOSGeometry - LinearRing geometry. Owned by parent geometry, do not free. NULL on exception. */ GEOSGetInteriorRingN(g: GEOSGeometry, n: number): GEOSGeometry; /** * Returns the N'th ring for a Polygon input. * @param handle - - * @param g - Input Polygon geometry * @param n - Index of the desired ring * @returns GEOSGeometry - LinearRing geometry. Owned by parent geometry, do not free. NULL on exception. */ GEOSGetInteriorRingN_r(handle: GEOSContextHandle_t, g: GEOSGeometry, n: number): GEOSGeometry; /** * Get the total number of points in a geometry, of any type. * @param g - Input geometry * @returns number - Number of points in the geometry. -1 on exception. */ GEOSGetNumCoordinates(g: GEOSGeometry): number; /** * Get the total number of points in a geometry, of any type. * @param handle - - * @param g - Input geometry * @returns number - Number of points in the geometry. -1 on exception. */ GEOSGetNumCoordinates_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Returns the number of sub-geometries immediately under a multi-geometry or collection or 1 for a simple geometry. For nested collections, remember to check if returned sub-geometries are themselves also collections. Empty collection or multi-geometry types return 0, and empty simple geometry types return 1. * @param g - Input geometry * @returns number - Number of direct children in this collection */ GEOSGetNumGeometries(g: GEOSGeometry): number; /** * Returns the number of sub-geometries immediately under a multi-geometry or collection or 1 for a simple geometry. For nested collections, remember to check if returned sub-geometries are themselves also collections. Empty collection or multi-geometry types return 0, and empty simple geometry types return 1. * @param handle - - * @param g - Input geometry * @returns number - Number of direct children in this collection */ GEOSGetNumGeometries_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Returns the number of interior rings, for a Polygon input, or an exception otherwise. * @param g - Input Polygon geometry * @returns number - Number of interior rings, -1 on exception */ GEOSGetNumInteriorRings(g: GEOSGeometry): number; /** * Returns the number of interior rings, for a Polygon input, or an exception otherwise. * @param handle - - * @param g - Input Polygon geometry * @returns number - Number of interior rings, -1 on exception */ GEOSGetNumInteriorRings_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Returns the "spatial reference id" (SRID) for this geometry. * @param g - Input geometry * @returns number - SRID number or 0 if unknown / not set. */ GEOSGetSRID(g: GEOSGeometry): number; /** * Returns the "spatial reference id" (SRID) for this geometry. * @param handle - - * @param g - Input geometry * @returns number - SRID number or 0 if unknown / not set. */ GEOSGetSRID_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Tests whether the input geometry has M coordinates. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSHasM(g: GEOSGeometry): number; /** * Tests whether the input geometry has M coordinates. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSHasM_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Tests whether the input geometry has Z coordinates. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSHasZ(g: GEOSGeometry): number; /** * Tests whether the input geometry has Z coordinates. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSHasZ_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Calculate the Hausdorff distance between two geometries. Hausdorff distance is the largest distance between two geometries. * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSHausdorffDistance(g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate the Hausdorff distance between two geometries. Hausdorff distance is the largest distance between two geometries. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSHausdorffDistance_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Calculate a more precise Hausdorff distance between two geometries, by densifying the inputs before computation. Hausdorff distance is the largest distance between two geometries. * @param g1 - Input geometry * @param g2 - Input geometry * @param densifyFrac - The largest % of the overall line length that any given two-point segment should be * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSHausdorffDistanceDensify(g1: GEOSGeometry, g2: GEOSGeometry, densifyFrac: number, dist: NumberPointer): number; /** * Calculate a more precise Hausdorff distance between two geometries, by densifying the inputs before computation. Hausdorff distance is the largest distance between two geometries. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @param densifyFrac - The largest % of the overall line length that any given two-point segment should be * @param dist - Pointer to be filled in with distance result * @returns number - 1 on success, 0 on exception. */ GEOSHausdorffDistanceDensify_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, densifyFrac: number, dist: NumberPointer): number; /** * Calculate the Hilbert code of the centroid of a geometry relative to an extent. This allows sorting geometries in a deterministic way, such that similar Hilbert codes are likely to be near each other in two-dimensional space. The caller must ensure that the geometry is contained within the extent. * @param geom - Input geometry, must be non-empty * @param extent - Extent within which to calculate the Hilbert code for geom * @param level - The level of precision of the Hilbert curve, up to 16 * @param code - Pointer to be filled in with Hilbert code result * @returns number - 1 on success, 0 on exception. */ GEOSHilbertCode(geom: GEOSGeometry, extent: GEOSGeometry, level: number, code: NumberPointer): number; /** * Calculate the Hilbert code of the centroid of a geometry relative to an extent. This allows sorting geometries in a deterministic way, such that similar Hilbert codes are likely to be near each other in two-dimensional space. The caller must ensure that the geometry is contained within the extent. * @param handle - - * @param geom - Input geometry, must be non-empty * @param extent - Extent within which to calculate the Hilbert code for geom * @param level - The level of precision of the Hilbert curve, up to 16 * @param code - Pointer to be filled in with Hilbert code result * @returns number - 1 on success, 0 on exception. */ GEOSHilbertCode_r(handle: GEOSContextHandle_t, geom: GEOSGeometry, extent: GEOSGeometry, level: number, code: NumberPointer): number; /** * Measuring from start of line, return point that is distance the start. Line parameter must be a LineString. The returned point is not guaranteed to intersect the line due to limitations of floating point calculations. * @param line - linear target of projection * @param d - distance from start of line to created point * @returns GEOSGeometry - The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry. */ GEOSInterpolate(line: GEOSGeometry, d: number): GEOSGeometry; /** * Measuring from start of line, return point that is distance the start. Line parameter must be a LineString. The returned point is not guaranteed to intersect the line due to limitations of floating point calculations. * @param handle - - * @param line - linear target of projection * @param d - distance from start of line to created point * @returns GEOSGeometry - The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry. */ GEOSInterpolate_r(handle: GEOSContextHandle_t, line: GEOSGeometry, d: number): GEOSGeometry; /** * Measuring from start of line, return point that is a proportion the start. Line parameter must be a LineString. * @param line - linear target of projection * @param proportion - The proportion from the start of line to created point * @returns GEOSGeometry - The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry. */ GEOSInterpolateNormalized(line: GEOSGeometry, proportion: number): GEOSGeometry; /** * Measuring from start of line, return point that is a proportion the start. Line parameter must be a LineString. * @param handle - - * @param g - linear target of projection * @param d - The proportion from the start of line to created point * @returns GEOSGeometry - The point GEOSGeometry that is distance from the start of line. Caller takes ownership of returned geometry. */ GEOSInterpolateNormalized_r(handle: GEOSContextHandle_t, g: GEOSGeometry, d: number): GEOSGeometry; /** * Returns the intersection of two geometries: the set of points that fall within both geometries. * @param g1 - one of the geometries * @param g2 - the other geometry * @returns GEOSGeometry - A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSIntersection(g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Returns the intersection of two geometries: the set of points that fall within both geometries. * @param handle - - * @param g1 - one of the geometries * @param g2 - the other geometry * @returns GEOSGeometry - A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSIntersection_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Returns the intersection of two geometries: the set of points that fall within both geometries. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param g1 - one of the geometries * @param g2 - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSIntersectionPrec(g1: GEOSGeometry, g2: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the intersection of two geometries: the set of points that fall within both geometries. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param handle - - * @param g1 - one of the geometries * @param g2 - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the intersection. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSIntersectionPrec_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, gridSize: number): GEOSGeometry; /** * True if geometries are not disjoint. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSIntersects(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries are not disjoint. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSIntersects_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Tests whether the input geometry is closed. A closed geometry is a linestring or multilinestring with the start and end points being the same. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisClosed(g: GEOSGeometry): number; /** * Tests whether the input geometry is closed. A closed geometry is a linestring or multilinestring with the start and end points being the same. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisClosed_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Tests whether the input geometry is empty. If the geometry or any component is non-empty, the geometry is non-empty. An empty geometry has no boundary or interior. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisEmpty(g: GEOSGeometry): number; /** * Tests whether the input geometry is empty. If the geometry or any component is non-empty, the geometry is non-empty. An empty geometry has no boundary or interior. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisEmpty_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Tests whether the input geometry is a ring. Rings are linestrings, without self-intersections, with start and end point being identical. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisRing(g: GEOSGeometry): number; /** * Tests whether the input geometry is a ring. Rings are linestrings, without self-intersections, with start and end point being identical. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisRing_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Tests whether the input geometry is "simple". Mostly relevant for linestrings. A "simple" linestring has no self-intersections. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisSimple(g: GEOSGeometry): number; /** * Tests whether the input geometry is "simple". Mostly relevant for linestrings. A "simple" linestring has no self-intersections. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisSimple_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Check the validity of the provided geometry. * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisValid(g: GEOSGeometry): number; /** * Check the validity of the provided geometry. * @param handle - - * @param g - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSisValid_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * In one step, calculate and return the validity, the human readable validity reason and a point at which validity rules are broken. Caller has the responsibility to destroy 'reason' with GEOSFree() and 'location' with GEOSGeom_destroy() * @param g - The geometry to test * @param flags - A value from the GEOSValidFlags enum * @param reason - A pointer in which the reason string will be places * @param location - A pointer in which the location GEOSGeometry will be placed * @returns number - 1 when valid, 0 when invalid, 2 on exception */ GEOSisValidDetail(g: GEOSGeometry, flags: number, reason: Pointer, location: GEOSGeometry): number; /** * In one step, calculate and return the validity, the human readable validity reason and a point at which validity rules are broken. Caller has the responsibility to destroy 'reason' with GEOSFree() and 'location' with GEOSGeom_destroy() * @param handle - - * @param g - The geometry to test * @param flags - A value from the GEOSValidFlags enum * @param reason - A pointer in which the reason string will be places * @param location - A pointer in which the location GEOSGeometry will be placed * @returns number - 1 when valid, 0 when invalid, 2 on exception */ GEOSisValidDetail_r(handle: GEOSContextHandle_t, g: GEOSGeometry, flags: number, reason: Pointer, location: GEOSGeometry): number; /** * Return the human readable reason a geometry is invalid, "Valid Geometry" string otherwise, or NULL on exception. * @param g - The geometry to test * @returns StringPointer - A string with the reason, NULL on exception. Caller must GEOSFree() their result. */ GEOSisValidReason(g: GEOSGeometry): StringPointer; /** * Return the human readable reason a geometry is invalid, "Valid Geometry" string otherwise, or NULL on exception. * @param handle - - * @param g - The geometry to test * @returns StringPointer - A string with the reason, NULL on exception. Caller must GEOSFree() their result. */ GEOSisValidReason_r(handle: GEOSContextHandle_t, g: GEOSGeometry): StringPointer; /** * Constructs the "largest empty circle" (LEC) for a set of obstacle geometries and within a polygonal boundary, with accuracy to to a specified distance tolerance. The obstacles may be any collection of points, lines and polygons. The LEC is the largest circle whose interior does not intersect with any obstacle. and which has its center inside the given boundary. If no boundary is provided, the convex hull of the obstacles is used. The LEC center is the point in the interior of the boundary which has the farthest distance from the obstacles (up to the given distance tolerance). The LEC is determined by the center point and a point indicating the circle radius (which will lie on an obstacle). * To compute an LEC which lies wholly within a polygonal boundary, include the boundary of the polygon(s) as a linear obstacle. * The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes. * Returns the LEC radius as a two-point linestring, with the start point at the center of the inscribed circle and the end on the boundary of the circle. * @param obstacles - The geometries that the LEC must not cross * @param boundary - The area to contain the LEC center (may be null or empty) * @param tolerance - Stop the algorithm when the search area is smaller than this tolerance * @returns GEOSGeometry - A newly allocated geometry of the LEC radius line. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLargestEmptyCircle(obstacles: GEOSGeometry, boundary: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Constructs the "largest empty circle" (LEC) for a set of obstacle geometries and within a polygonal boundary, with accuracy to to a specified distance tolerance. The obstacles may be any collection of points, lines and polygons. The LEC is the largest circle whose interior does not intersect with any obstacle. and which has its center inside the given boundary. If no boundary is provided, the convex hull of the obstacles is used. The LEC center is the point in the interior of the boundary which has the farthest distance from the obstacles (up to the given distance tolerance). The LEC is determined by the center point and a point indicating the circle radius (which will lie on an obstacle). * To compute an LEC which lies wholly within a polygonal boundary, include the boundary of the polygon(s) as a linear obstacle. * The implementation uses a successive-approximation technique over a grid of square cells covering the obstacles and boundary. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes. * Returns the LEC radius as a two-point linestring, with the start point at the center of the inscribed circle and the end on the boundary of the circle. * @param handle - - * @param g - The geometries that the LEC must not cross * @param boundary - The area to contain the LEC center (may be null or empty) * @param tolerance - Stop the algorithm when the search area is smaller than this tolerance * @returns GEOSGeometry - A newly allocated geometry of the LEC radius line. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLargestEmptyCircle_r(handle: GEOSContextHandle_t, g: GEOSGeometry, boundary: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Calculate the length of a geometry. * @param g - Input geometry * @param length - Pointer to be filled in with length result * @returns number - 1 on success, 0 on exception. */ GEOSLength(g: GEOSGeometry, length: NumberPointer): number; /** * Calculate the length of a geometry. * @param handle - - * @param g - Input geometry * @param length - Pointer to be filled in with length result * @returns number - 1 on success, 0 on exception. */ GEOSLength_r(handle: GEOSContextHandle_t, g: GEOSGeometry, length: NumberPointer): number; /** * Merges a set of LineStrings, joining them at nodes which have cardinality 2. Lines may have their direction reversed. * @param g - The input linework * @returns GEOSGeometry - The merged linework. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLineMerge(g: GEOSGeometry): GEOSGeometry; /** * Merges a set of LineStrings, joining them at nodes which have cardinality 2. Lines may have their direction reversed. * @param handle - - * @param g - The input linework * @returns GEOSGeometry - The merged linework. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLineMerge_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Merges a set of LineStrings, joining them at nodes which have cardinality 2. and where the lines have the same direction. This means that lines do not have their direction reversed. * @param g - The input linework * @returns GEOSGeometry - The merged linework. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLineMergeDirected(g: GEOSGeometry): GEOSGeometry; /** * Merges a set of LineStrings, joining them at nodes which have cardinality 2. and where the lines have the same direction. This means that lines do not have their direction reversed. * @param handle - - * @param g - The input linework * @returns GEOSGeometry - The merged linework. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSLineMergeDirected_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Computes the line which is the section of the input LineString starting and ending at the given length fractions. * @param g - The input LineString * @param start_fraction - start fraction (0-1) along the length of g * @param end_fraction - end fraction (0-1) along the length of g * @returns GEOSGeometry - selected substring. Caller is responsible for freeing with GEOSGeom_destroy() */ GEOSLineSubstring(g: GEOSGeometry, start_fraction: number, end_fraction: number): GEOSGeometry; /** * Computes the line which is the section of the input LineString starting and ending at the given length fractions. * @param handle - - * @param g - The input LineString * @param start_fraction - start fraction (0-1) along the length of g * @param end_fdraction - end fraction (0-1) along the length of g * @returns GEOSGeometry - selected substring. Caller is responsible for freeing with GEOSGeom_destroy() */ GEOSLineSubstring_r(handle: GEOSContextHandle_t, g: GEOSGeometry, start_fraction: number, end_fdraction: number): GEOSGeometry; /** * Repair an invalid geometry, returning a valid output. * @param g - The geometry to repair * @returns GEOSGeometry - The repaired geometry. Caller must free with GEOSGeom_destroy(). */ GEOSMakeValid(g: GEOSGeometry): GEOSGeometry; /** * Repair an invalid geometry, returning a valid output. * @param handle - - * @param g - The geometry to repair * @returns GEOSGeometry - The repaired geometry. Caller must free with GEOSGeom_destroy(). */ GEOSMakeValid_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Create a GEOSMakeValidParams to hold the desired parameters to control the algorithm and behavior of the validation process. * @returns GEOSMakeValidParams - a parameter object */ GEOSMakeValidParams_create(): GEOSMakeValidParams; /** * Create a GEOSMakeValidParams to hold the desired parameters to control the algorithm and behavior of the validation process. * @param extHandle - - * @returns GEOSMakeValidParams - a parameter object */ GEOSMakeValidParams_create_r(extHandle: GEOSContextHandle_t): GEOSMakeValidParams; /** * Destroy a GEOSMakeValidParams. * @param parms - the object to destroy * @returns null - void */ GEOSMakeValidParams_destroy(parms: GEOSMakeValidParams): null; /** * Destroy a GEOSMakeValidParams. * @param handle - - * @param parms - the object to destroy * @returns null - void */ GEOSMakeValidParams_destroy_r(handle: GEOSContextHandle_t, parms: GEOSMakeValidParams): null; /** * When this parameter is nn-zero, the GEOS_MAKE_VALID_STRUCTURE method will keep components that have collapsed into a lower dimensionality. For example, a ring collapsing to a line, or a line collapsing to a point. * @param p - - * @param keepCollapsed - - * @returns number - 0 on exception, 1 on success. */ GEOSMakeValidParams_setKeepCollapsed(p: GEOSMakeValidParams, keepCollapsed: number): number; /** * When this parameter is nn-zero, the GEOS_MAKE_VALID_STRUCTURE method will keep components that have collapsed into a lower dimensionality. For example, a ring collapsing to a line, or a line collapsing to a point. * @param handle - - * @param p - - * @param style - - * @returns number - 0 on exception, 1 on success. */ GEOSMakeValidParams_setKeepCollapsed_r(handle: GEOSContextHandle_t, p: GEOSMakeValidParams, style: number): number; /** * Set the GEOSMakeValidMethods to use in making the geometry valid. * @param p - - * @param method - - * @returns number - 0 on exception, 1 on success. */ GEOSMakeValidParams_setMethod(p: GEOSMakeValidParams, method: GEOSMakeValidMethods): number; /** * Set the GEOSMakeValidMethods to use in making the geometry valid. * @param handle - - * @param p - - * @param method - - * @returns number - 0 on exception, 1 on success. */ GEOSMakeValidParams_setMethod_r(handle: GEOSContextHandle_t, p: GEOSMakeValidParams, method: GEOSMakeValidMethods): number; /** * Repair an invalid geometry, returning a valid output, using the indicated GEOSMakeValidMethods algorithm and options. * @param g - is the geometry to test. * @param makeValidParams - is a GEOSMakeValidParams with the desired parameters set on it. * @returns GEOSGeometry - A repaired geometry. Caller must free with GEOSGeom_destroy(). */ GEOSMakeValidWithParams(g: GEOSGeometry, makeValidParams: GEOSMakeValidParams): GEOSGeometry; /** * Repair an invalid geometry, returning a valid output, using the indicated GEOSMakeValidMethods algorithm and options. * @param handle - - * @param g - is the geometry to test. * @param makeValidParams - is a GEOSMakeValidParams with the desired parameters set on it. * @returns GEOSGeometry - A repaired geometry. Caller must free with GEOSGeom_destroy(). */ GEOSMakeValidWithParams_r(handle: GEOSContextHandle_t, g: GEOSGeometry, makeValidParams: GEOSMakeValidParams): GEOSGeometry; /** * Constructs the "maximum inscribed circle" (MIC) for a polygonal geometry, up to a specified tolerance. The MIC is determined by a point in the interior of the area which has the farthest distance from the area boundary, along with a boundary point at that distance. In the context of geography the center of the MIC is known as the "pole of inaccessibility". A cartographic use case is to determine a suitable point to place a map label within a polygon. The radius length of the MIC is a measure of how "narrow" a polygon is. It is the distance at which the negative buffer becomes empty. The class supports polygons with holes and multipolygons. The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes. Returns a two-point linestring, with one point at the center of the inscribed circle and the other on the boundary of the inscribed circle. * @param g - Input geometry * @param tolerance - Stop the algorithm when the search area is smaller than this tolerance * @returns GEOSGeometry - A newly allocated geometry of the MIC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMaximumInscribedCircle(g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Constructs the "maximum inscribed circle" (MIC) for a polygonal geometry, up to a specified tolerance. The MIC is determined by a point in the interior of the area which has the farthest distance from the area boundary, along with a boundary point at that distance. In the context of geography the center of the MIC is known as the "pole of inaccessibility". A cartographic use case is to determine a suitable point to place a map label within a polygon. The radius length of the MIC is a measure of how "narrow" a polygon is. It is the distance at which the negative buffer becomes empty. The class supports polygons with holes and multipolygons. The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes. Returns a two-point linestring, with one point at the center of the inscribed circle and the other on the boundary of the inscribed circle. * @param handle - - * @param g - Input geometry * @param tolerance - Stop the algorithm when the search area is smaller than this tolerance * @returns GEOSGeometry - A newly allocated geometry of the MIC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMaximumInscribedCircle_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Returns a geometry which represents the "minimum bounding circle", the smallest circle that contains the input. * @param g - The input geometry * @param radius - Pointer will be filled with output radius. * @param center - Pointer will be filled with output circle center. Caller must free. * @returns GEOSGeometry - The circle geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumBoundingCircle(g: GEOSGeometry, radius: NumberPointer, center: GEOSGeometry): GEOSGeometry; /** * Returns a geometry which represents the "minimum bounding circle", the smallest circle that contains the input. * @param handle - - * @param g - The input geometry * @param radius - Pointer will be filled with output radius. * @param center - Pointer will be filled with output circle center. Caller must free. * @returns GEOSGeometry - The circle geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumBoundingCircle_r(handle: GEOSContextHandle_t, g: GEOSGeometry, radius: NumberPointer, center: GEOSGeometry): GEOSGeometry; /** * Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with repeated points. If a geometry has a minimum clearance of 'eps', it can be said that: * @param g - the input geometry * @param d - a double to which the result can be stored * @returns number - 0 if no exception occurred. 2 if an exception occurred. */ GEOSMinimumClearance(g: GEOSGeometry, d: NumberPointer): number; /** * Computes the minimum clearance of a geometry. The minimum clearance is the smallest amount by which a vertex could be move to produce an invalid polygon, a non-simple linestring, or a multipoint with repeated points. If a geometry has a minimum clearance of 'eps', it can be said that: * @param handle - - * @param g - the input geometry * @param distance - a double to which the result can be stored * @returns number - 0 if no exception occurred. 2 if an exception occurred. */ GEOSMinimumClearance_r(handle: GEOSContextHandle_t, g: GEOSGeometry, distance: NumberPointer): number; /** * Returns a LineString whose endpoints define the minimum clearance of a geometry. If the geometry has no minimum clearance, an empty LineString will be returned. * @param g - the input geometry * @returns GEOSGeometry - a linestring geometry, or NULL if an exception occurred. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumClearanceLine(g: GEOSGeometry): GEOSGeometry; /** * Returns a LineString whose endpoints define the minimum clearance of a geometry. If the geometry has no minimum clearance, an empty LineString will be returned. * @param handle - - * @param g - the input geometry * @returns GEOSGeometry - a linestring geometry, or NULL if an exception occurred. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumClearanceLine_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns the minimum rotated rectangular POLYGON which encloses the input geometry. The rectangle has width equal to the minimum diameter, and a longer length. If the convex hill of the input is degenerate (a line or point) a linestring or point is returned. The minimum rotated rectangle can be used as an extremely generalized representation for the given geometry. * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the rotated envelope. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumRotatedRectangle(g: GEOSGeometry): GEOSGeometry; /** * Returns the minimum rotated rectangular POLYGON which encloses the input geometry. The rectangle has width equal to the minimum diameter, and a longer length. If the convex hill of the input is degenerate (a line or point) a linestring or point is returned. The minimum rotated rectangle can be used as an extremely generalized representation for the given geometry. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the rotated envelope. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumRotatedRectangle_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns a linestring geometry which represents the minimum diameter of the geometry. The minimum diameter is defined to be the width of the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the geometry can be moved through, with a single rotation. * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the LEC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumWidth(g: GEOSGeometry): GEOSGeometry; /** * Returns a linestring geometry which represents the minimum diameter of the geometry. The minimum diameter is defined to be the width of the smallest band that contains the geometry, where a band is a strip of the plane defined by two parallel lines. This can be thought of as the smallest hole that the geometry can be moved through, with a single rotation. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the LEC. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSMinimumWidth_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * The closest points of the two geometries. The first point comes from g1 geometry and the second point comes from g2. * @param g1 - Input geometry * @param g2 - Input geometry * @returns GEOSCoordSequence - A coordinate sequence with the two points, or NULL on exception. Caller must free with GEOSCoordSeq_destroy(). */ GEOSNearestPoints(g1: GEOSGeometry, g2: GEOSGeometry): GEOSCoordSequence; /** * The closest points of the two geometries. The first point comes from g1 geometry and the second point comes from g2. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns GEOSCoordSequence - A coordinate sequence with the two points, or NULL on exception. Caller must free with GEOSCoordSeq_destroy(). */ GEOSNearestPoints_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSCoordSequence; /** * For linear inputs, returns a new geometry in which no lines cross each other, and all touching occurs at end points. * @param g - The input geometry * @returns GEOSGeometry - The noded geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSNode(g: GEOSGeometry): GEOSGeometry; /** * For linear inputs, returns a new geometry in which no lines cross each other, and all touching occurs at end points. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - The noded geometry or NULL on exception Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSNode_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Organize the elements, rings, and coordinate order of geometries in a consistent way, so that geometries that represent the same object can be easily compared. Modifies the geometry in-place. * @param g - Input geometry * @returns number - 0 on success or -1 on exception */ GEOSNormalize(g: GEOSGeometry): number; /** * Organize the elements, rings, and coordinate order of geometries in a consistent way, so that geometries that represent the same object can be easily compared. Modifies the geometry in-place. * @param handle - - * @param g - Input geometry * @returns number - 0 on success or -1 on exception */ GEOSNormalize_r(handle: GEOSContextHandle_t, g: GEOSGeometry): number; /** * Generates offset curve line(s) for a geometry. Handles all geometry types as input. * @param g - The linear geometry to offset from * @param width - Distance to offset from the curve. Negative for a right-side offset. Positive for a left-side offset. * @param quadsegs - Number of segments per quadrant * @param joinStyle - See GEOSBufJoinStyles * @param mitreLimit - See GEOSBufferParams_setMitreLimit * @returns GEOSGeometry - The offset geometry. Returns NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSOffsetCurve(g: GEOSGeometry, width: number, quadsegs: number, joinStyle: number, mitreLimit: number): GEOSGeometry; /** * Generates offset curve line(s) for a geometry. Handles all geometry types as input. * @param handle - - * @param g - The linear geometry to offset from * @param width - Distance to offset from the curve. Negative for a right-side offset. Positive for a left-side offset. * @param quadsegs - Number of segments per quadrant * @param joinStyle - See GEOSBufJoinStyles * @param mitreLimit - See GEOSBufferParams_setMitreLimit * @returns GEOSGeometry - The offset geometry. Returns NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSOffsetCurve_r(handle: GEOSContextHandle_t, g: GEOSGeometry, width: number, quadsegs: number, joinStyle: number, mitreLimit: number): GEOSGeometry; /** * For the points formed by the six input ordinates, walking from A to B and then to P. * @param Ax - X coordinate of A * @param Ay - Y coordinate of A * @param Bx - X coordinate of B * @param By - Y coordinate of B * @param Px - X coordinate of P * @param Py - Y coordinate of P * @returns number - -1 if reaching P takes a counter-clockwise (left) turn, 1 if reaching P takes a clockwise (right) turn, 0 if P is collinear with A-B */ GEOSOrientationIndex(Ax: number, Ay: number, Bx: number, By: number, Px: number, Py: number): number; /** * For the points formed by the six input ordinates, walking from A to B and then to P. * @param handle - - * @param Ax - X coordinate of A * @param Ay - Y coordinate of A * @param Bx - X coordinate of B * @param By - Y coordinate of B * @param Px - X coordinate of P * @param Py - Y coordinate of P * @returns number - -1 if reaching P takes a counter-clockwise (left) turn, 1 if reaching P takes a clockwise (right) turn, 0 if P is collinear with A-B */ GEOSOrientationIndex_r(handle: GEOSContextHandle_t, Ax: number, Ay: number, Bx: number, By: number, Px: number, Py: number): number; /** * Enforce a ring orientation on all polygonal elements in the input geometry. Non-polygonal geometries will not be modified. * @param g - Input geometry * @param exteriorCW - if 1, exterior rings will be clockwise and interior rings will be counter-clockwise * @returns number - 0 on success or -1 on exception */ GEOSOrientPolygons(g: GEOSGeometry, exteriorCW: number): number; /** * Enforce a ring orientation on all polygonal elements in the input geometry. Non-polygonal geometries will not be modified. * @param handle - - * @param g - Input geometry * @param exteriorCW - if 1, exterior rings will be clockwise and interior rings will be counter-clockwise * @returns number - 0 on success or -1 on exception */ GEOSOrientPolygons_r(handle: GEOSContextHandle_t, g: GEOSGeometry, exteriorCW: number): number; /** * True if geometries share interiors but are neither within nor contained. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSOverlaps(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries share interiors but are neither within nor contained. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSOverlaps_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Returns a point that is inside the boundary of a polygonal geometry. * @param g - The input geometry * @returns GEOSGeometry - A point that is inside the input Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPointOnSurface(g: GEOSGeometry): GEOSGeometry; /** * Returns a point that is inside the boundary of a polygonal geometry. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A point that is inside the input Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPointOnSurface_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Computes a boundary-respecting hull of a polygonal geometry, with hull shape determined by a target parameter specifying the fraction of the input vertices retained in the result. Larger values produce less concave results. A value of 1 produces the convex hull; a value of 0 produces the original geometry. An outer hull is computed if the parameter is positive, an inner hull is computed if it is negative. * @param g - the polygonal geometry to process * @param isOuter - indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner) * @param vertexNumFraction - the target fraction of the count of input vertices to retain in result * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSPolygonHullSimplify(g: GEOSGeometry, isOuter: number, vertexNumFraction: number): GEOSGeometry; /** * Computes a boundary-respecting hull of a polygonal geometry, with hull shape determined by a target parameter specifying the fraction of the input vertices retained in the result. Larger values produce less concave results. A value of 1 produces the convex hull; a value of 0 produces the original geometry. An outer hull is computed if the parameter is positive, an inner hull is computed if it is negative. * @param handle - - * @param g - the polygonal geometry to process * @param isOuter - indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner) * @param vertexNumFraction - the target fraction of the count of input vertices to retain in result * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSPolygonHullSimplify_r(handle: GEOSContextHandle_t, g: GEOSGeometry, isOuter: number, vertexNumFraction: number): GEOSGeometry; /** * Computes a topology-preserving simplified hull of a polygonal geometry, with hull shape determined by the parameter, controlled by a parameter mode, which is one defined in GEOSPolygonHullParameterModes. Larger values compute less concave results and a value of 0 produces the original geometry. Either outer or inner hulls can be computed. * @param g - the polygonal geometry to process * @param isOuter - indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner) * @param parameterMode - the interpretation to apply to the parameter argument; see GEOSPolygonHullParameterModes * @param parameter - the target ratio of area difference to original area * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSPolygonHullSimplifyMode(g: GEOSGeometry, isOuter: number, parameterMode: number, parameter: number): GEOSGeometry; /** * Computes a topology-preserving simplified hull of a polygonal geometry, with hull shape determined by the parameter, controlled by a parameter mode, which is one defined in GEOSPolygonHullParameterModes. Larger values compute less concave results and a value of 0 produces the original geometry. Either outer or inner hulls can be computed. * @param handle - - * @param g - the polygonal geometry to process * @param isOuter - indicates whether to compute an outer or inner hull (1 for outer hull, 0 for inner) * @param parameterMode - the interpretation to apply to the parameter argument; see GEOSPolygonHullParameterModes * @param parameter - the target ratio of area difference to original area * @returns GEOSGeometry - A newly allocated geometry of the concave hull. NULL on exception. */ GEOSPolygonHullSimplifyMode_r(handle: GEOSContextHandle_t, g: GEOSGeometry, isOuter: number, parameterMode: number, parameter: number): GEOSGeometry; /** * Polygonizes a set of Geometries which contain linework that represents the edges of a planar graph. * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngeoms - Size of the geoms array. * @returns GEOSGeometry - The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize(geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Perform the polygonization as GEOSPolygonize() and return the polygonal result as well as all extra outputs. * @param input - A single geometry with all the input lines to polygonize. * @param cuts - Pointer to hold "cut edges", connected on both ends but not part of output. Caller must free. * @param dangles - Pointer to hold "dangles", connected one end but not part of output. Caller must free. * @param invalid - Pointer to hold invalid outputs, polygons formed but not valid. Caller must free. * @returns GEOSGeometry - The polygonal valid output Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize_full(input: GEOSGeometry, cuts: GEOSGeometry, dangles: GEOSGeometry, invalid: GEOSGeometry): GEOSGeometry; /** * Perform the polygonization as GEOSPolygonize() and return the polygonal result as well as all extra outputs. * @param handle - - * @param input - A single geometry with all the input lines to polygonize. * @param cuts - Pointer to hold "cut edges", connected on both ends but not part of output. Caller must free. * @param dangles - Pointer to hold "dangles", connected one end but not part of output. Caller must free. * @param invalidRings - Pointer to hold invalid outputs, polygons formed but not valid. Caller must free. * @returns GEOSGeometry - The polygonal valid output Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize_full_r(handle: GEOSContextHandle_t, input: GEOSGeometry, cuts: GEOSGeometry, dangles: GEOSGeometry, invalidRings: GEOSGeometry): GEOSGeometry; /** * Polygonizes a set of Geometries which contain linework that represents the edges of a planar graph. * @param handle - - * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngeoms - Size of the geoms array. * @returns GEOSGeometry - The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize_r(handle: GEOSContextHandle_t, geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Has the same polygonizing behavior as GEOSPolygonize(), but returns a result which is a valid polygonal geometry. The result will not contain any edge-adjacent elements. * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngeoms - Size of the geoms array. * @returns GEOSGeometry - The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize_valid(geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Has the same polygonizing behavior as GEOSPolygonize(), but returns a result which is a valid polygonal geometry. The result will not contain any edge-adjacent elements. * @param handle - - * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngems - Size of the geoms array. * @returns GEOSGeometry - The polygonal output geometry. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonize_valid_r(handle: GEOSContextHandle_t, geoms: GEOSGeometry, ngems: number): GEOSGeometry; /** * Perform the polygonization as GEOSPolygonize() but return only the "cut edges", the linear features that are connected at both ends, do not participate in the final polygon. * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngeoms - Size of the geoms array. * @returns GEOSGeometry - The "cut edges" Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonizer_getCutEdges(geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Perform the polygonization as GEOSPolygonize() but return only the "cut edges", the linear features that are connected at both ends, do not participate in the final polygon. * @param handle - - * @param geoms - Array of linear geometries to polygons. Caller retains ownersihp of both array container and objects. * @param ngeoms - Size of the geoms array. * @returns GEOSGeometry - The "cut edges" Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSPolygonizer_getCutEdges_r(handle: GEOSContextHandle_t, geoms: GEOSGeometry, ngeoms: number): GEOSGeometry; /** * Create a Prepared Geometry. The caller retains ownership of the base geometry, and after processing is complete, must free both the prepared and the base geometry. (Ideally, destroy the prepared geometry first, as it has an internal reference to the base geometry.) * @param g - The base geometry to wrap in a prepared geometry. * @returns GEOSPreparedGeometry - A prepared geometry. Caller is responsible for freeing with GEOSPreparedGeom_destroy() */ GEOSPrepare(g: GEOSGeometry): GEOSPreparedGeometry; /** * Create a Prepared Geometry. The caller retains ownership of the base geometry, and after processing is complete, must free both the prepared and the base geometry. (Ideally, destroy the prepared geometry first, as it has an internal reference to the base geometry.) * @param handle - - * @param g - The base geometry to wrap in a prepared geometry. * @returns GEOSPreparedGeometry - A prepared geometry. Caller is responsible for freeing with GEOSPreparedGeom_destroy() */ GEOSPrepare_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSPreparedGeometry; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContains(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContains_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained properly. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContainsProperly(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is contained properly. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContainsProperly_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point is contained. * @param pg1 - The prepared geometry * @param x - x coordinate of point to test * @param y - y coordinate of point to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContainsXY(pg1: GEOSPreparedGeometry, x: number, y: number): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point is contained. * @param handle - - * @param pg1 - The prepared geometry * @param x - x coordinate of point to test * @param y - y coordinate of point to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedContainsXY_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, x: number, y: number): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is covered by. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCoveredBy(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is covered by. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCoveredBy_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry covers. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCovers(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry covers. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCovers_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry crosses. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCrosses(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Using a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry crosses. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedCrosses_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is disjoint. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedDisjoint(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is disjoint. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedDisjoint_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation to find the distance between the prepared and provided geometry. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param dist - Pointer to store the result in * @returns number - 1 on success */ GEOSPreparedDistance(pg1: GEOSPreparedGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Use a GEOSPreparedGeometry do a high performance calculation to find the distance between the prepared and provided geometry. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param dist - Pointer to store the result in * @returns number - 1 on success */ GEOSPreparedDistance_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry, dist: NumberPointer): number; /** * Use a GEOSPreparedGeometry do a high performance calculation to find whether the prepared and provided geometry are within the given max distance. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param dist - The max distance * @returns number - 1 on success */ GEOSPreparedDistanceWithin(pg1: GEOSPreparedGeometry, g2: GEOSGeometry, dist: number): number; /** * Use a GEOSPreparedGeometry do a high performance calculation to find whether the prepared and provided geometry are within the given max distance. Useful for situations where one geometry is large and static and needs to be tested against a large number of other geometries. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param dist - The max distance * @returns number - 1 on success */ GEOSPreparedDistanceWithin_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry, dist: number): number; /** * Free the memory associated with a GEOSPreparedGeometry. Caller must separately free the base GEOSGeometry used to create the prepared geometry. * @param g - Prepared geometry to destroy. * @returns null - void */ GEOSPreparedGeom_destroy(g: GEOSPreparedGeometry): null; /** * Free the memory associated with a GEOSPreparedGeometry. Caller must separately free the base GEOSGeometry used to create the prepared geometry. * @param handle - - * @param g - Prepared geometry to destroy. * @returns null - void */ GEOSPreparedGeom_destroy_r(handle: GEOSContextHandle_t, g: GEOSPreparedGeometry): null; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry intersects. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedIntersects(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry intersects. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedIntersects_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point intersects. * @param pg1 - The prepared geometry * @param x - x coordinate of point to test * @param y - y coordinate of point to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedIntersectsXY(pg1: GEOSPreparedGeometry, x: number, y: number): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided point intersects. * @param handle - - * @param pg1 - The prepared geometry * @param x - x coordinate of point to test * @param y - y coordinate of point to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedIntersectsXY_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, x: number, y: number): number; /** * Use a GEOSPreparedGeometry do a high performance calculation to find the nearest points between the prepared and provided geometry. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns GEOSCoordSequence - A coordinate sequence containing the nearest points, or NULL on exception. The first point in the sequence is from the prepared geometry, and the seconds is from the other argument. */ GEOSPreparedNearestPoints(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): GEOSCoordSequence; /** * Use a GEOSPreparedGeometry do a high performance calculation to find the nearest points between the prepared and provided geometry. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns GEOSCoordSequence - A coordinate sequence containing the nearest points, or NULL on exception. The first point in the sequence is from the prepared geometry, and the seconds is from the other argument. */ GEOSPreparedNearestPoints_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): GEOSCoordSequence; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry overlaps. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedOverlaps(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry overlaps. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedOverlaps_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns StringPointer - The DE9IM string */ GEOSPreparedRelate(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): StringPointer; /** * Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns StringPointer - The DE9IM string */ GEOSPreparedRelate_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): StringPointer; /** * Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry, and compare the relationship to the provided DE9IM pattern. Returns true if the patterns are consistent and false otherwise. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param imPattern - The DE9IM pattern to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedRelatePattern(pg1: GEOSPreparedGeometry, g2: GEOSGeometry, imPattern: StringPointer): number; /** * Use a GEOSPreparedGeometry do a high-performance calculation of the DE9IM relationship between the prepared and provided geometry, and compare the relationship to the provided DE9IM pattern. Returns true if the patterns are consistent and false otherwise. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @param im - The DE9IM pattern to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedRelatePattern_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry, im: StringPointer): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry touches. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedTouches(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry touches. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedTouches_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is within. * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedWithin(pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Use a GEOSPreparedGeometry do a high performance calculation of whether the provided geometry is within. * @param handle - - * @param pg1 - The prepared geometry * @param g2 - The geometry to test * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSPreparedWithin_r(handle: GEOSContextHandle_t, pg1: GEOSPreparedGeometry, g2: GEOSGeometry): number; /** * Distance of point projected onto line from the start of the line. * @param line - linear target of projection * @param point - point to be projected onto 'g' * @returns number - distance along line that point projects to, -1 on exception */ GEOSProject(line: GEOSGeometry, point: GEOSGeometry): number; /** * Distance of point projected onto line from the start of the line. * @param handle - - * @param line - linear target of projection * @param point - point to be projected onto 'g' * @returns number - distance along line that point projects to, -1 on exception */ GEOSProject_r(handle: GEOSContextHandle_t, line: GEOSGeometry, point: GEOSGeometry): number; /** * Project point to line and calculate the proportion of the line the point is from the start. For example, a point that projects to the middle of a line would be return 0.5. * @param line - linear target of projection * @param point - the point to project * @returns number - The proportion of the overall line length that the projected point falls at. */ GEOSProjectNormalized(line: GEOSGeometry, point: GEOSGeometry): number; /** * Project point to line and calculate the proportion of the line the point is from the start. For example, a point that projects to the middle of a line would be return 0.5. * @param handle - - * @param g - linear target of projection * @param p - the point to project * @returns number - The proportion of the overall line length that the projected point falls at. */ GEOSProjectNormalized_r(handle: GEOSContextHandle_t, g: GEOSGeometry, p: GEOSGeometry): number; /** * Calculate the DE9IM string for this geometry pair. The result is a 9-character string containing dimension symbols in the set "012F". * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @returns StringPointer - DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception */ GEOSRelate(g1: GEOSGeometry, g2: GEOSGeometry): StringPointer; /** * Calculate the DE9IM string for this geometry pair. The result is a 9-character string containing dimension symbols in the set "012F". * @param handle - - * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @returns StringPointer - DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception */ GEOSRelate_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): StringPointer; /** * Calculate the DE9IM string for this geometry pair, using the supplied GEOSRelateBoundaryNodeRules. * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @param bnr - A member of the GEOSRelateBoundaryNodeRules enum * @returns StringPointer - DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception */ GEOSRelateBoundaryNodeRule(g1: GEOSGeometry, g2: GEOSGeometry, bnr: number): StringPointer; /** * Calculate the DE9IM string for this geometry pair, using the supplied GEOSRelateBoundaryNodeRules. * @param handle - - * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @param bnr - A member of the GEOSRelateBoundaryNodeRules enum * @returns StringPointer - DE9IM string. Caller is responsible for freeing with GEOSFree(). NULL on exception */ GEOSRelateBoundaryNodeRule_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, bnr: number): StringPointer; /** * Calculate the DE9IM string for a geometry pair and compare against a DE9IM pattern to check for consistency. If the result matches the pattern return true. The pattern is a 9-character string containing symbols in the set "012TF*". "012F" match the corresponding dimension symbol; "T" matches any non-empty dimension; "*" matches any dimension. * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @param imPattern - DE9IM pattern to match * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSRelatePattern(g1: GEOSGeometry, g2: GEOSGeometry, imPattern: StringPointer): number; /** * Calculate the DE9IM string for a geometry pair and compare against a DE9IM pattern to check for consistency. If the result matches the pattern return true. The pattern is a 9-character string containing symbols in the set "012TF*". "012F" match the corresponding dimension symbol; "T" matches any non-empty dimension; "*" matches any dimension. * @param handle - - * @param g1 - First geometry in pair * @param g2 - Second geometry in pair * @param imPattern - DE9IM pattern to match * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSRelatePattern_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, imPattern: StringPointer): number; /** * Compare a DE9IM string to a pattern and return true if they are consistent. * @param intMatrix - DE9IM string (contains symbols "012F") * @param imPattern - Pattern to match to (may also contain symbols "T" and "*") * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSRelatePatternMatch(intMatrix: StringPointer, imPattern: StringPointer): number; /** * Compare a DE9IM string to a pattern and return true if they are consistent. * @param handle - - * @param intMatrix - DE9IM string (contains symbols "012F") * @param imPattern - Pattern to match to (may also contain symbols "T" and "*") * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSRelatePatternMatch_r(handle: GEOSContextHandle_t, intMatrix: StringPointer, imPattern: StringPointer): number; /** * Works from start of each coordinate sequence in the geometry, retaining points that are further away from the previous retained point than the tolerance value. * @param g - The geometry to filter * @param tolerance - Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points. * @returns GEOSGeometry - A geometry with all points within the tolerance of each other removed. */ GEOSRemoveRepeatedPoints(g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Works from start of each coordinate sequence in the geometry, retaining points that are further away from the previous retained point than the tolerance value. * @param handle - - * @param g - The geometry to filter * @param tolerance - Remove all points within this distance of each other. Use 0.0 to remove only exactly repeated points. * @returns GEOSGeometry - A geometry with all points within the tolerance of each other removed. */ GEOSRemoveRepeatedPoints_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * For geometries with coordinate sequences, reverses the order of the sequences. Converts CCW rings to CW. Reverses direction of LineStrings. * @param g - The input geometry * @returns GEOSGeometry - The reversed geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSReverse(g: GEOSGeometry): GEOSGeometry; /** * For geometries with coordinate sequences, reverses the order of the sequences. Converts CCW rings to CW. Reverses direction of LineStrings. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - The reversed geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSReverse_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Computes the coordinate where two line segments intersect, if any * @param ax0 - x-coordinate of 1st point in 1st segment * @param ay0 - y-coordinate of 1st point in 1st segment * @param ax1 - x-coordinate of 2nd point in 1st segment * @param ay1 - y-coordinate of 2nd point in 1st segment * @param bx0 - x-coordinate of 1st point in 2nd segment * @param by0 - y-coordinate of 1st point in 2nd segment * @param bx1 - x-coordinate of 2nd point in 2nd segment * @param by1 - y-coordinate of 2nd point in 2nd segment * @param cx - x-coordinate of intersection point * @param cy - y-coordinate of intersection point * @returns number - 0 on error, 1 on success, -1 if segments do not intersect */ GEOSSegmentIntersection(ax0: number, ay0: number, ax1: number, ay1: number, bx0: number, by0: number, bx1: number, by1: number, cx: NumberPointer, cy: NumberPointer): number; /** * Computes the coordinate where two line segments intersect, if any * @param extHandle - - * @param ax0 - x-coordinate of 1st point in 1st segment * @param ay0 - y-coordinate of 1st point in 1st segment * @param ax1 - x-coordinate of 2nd point in 1st segment * @param ay1 - y-coordinate of 2nd point in 1st segment * @param bx0 - x-coordinate of 1st point in 2nd segment * @param by0 - y-coordinate of 1st point in 2nd segment * @param bx1 - x-coordinate of 2nd point in 2nd segment * @param by1 - y-coordinate of 2nd point in 2nd segment * @param cx - x-coordinate of intersection point * @param cy - y-coordinate of intersection point * @returns number - 0 on error, 1 on success, -1 if segments do not intersect */ GEOSSegmentIntersection_r(extHandle: GEOSContextHandle_t, ax0: number, ay0: number, ax1: number, ay1: number, bx0: number, by0: number, bx1: number, by1: number, cx: NumberPointer, cy: NumberPointer): number; /** * Set the "spatial reference id" (SRID) for this geometry. * @param g - Input geometry * @param SRID - SRID number or 0 for unknown SRID. * @returns null - void */ GEOSSetSRID(g: GEOSGeometry, SRID: number): null; /** * Set the "spatial reference id" (SRID) for this geometry. * @param handle - - * @param g - Input geometry * @param SRID - SRID number or 0 for unknown SRID. * @returns null - void */ GEOSSetSRID_r(handle: GEOSContextHandle_t, g: GEOSGeometry, SRID: number): null; /** * Find paths shared between the two given lineal geometries. * @param g1 - An input geometry * @param g2 - An input geometry * @returns GEOSGeometry - The shared paths Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSharedPaths(g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Find paths shared between the two given lineal geometries. * @param handle - - * @param g1 - An input geometry * @param g2 - An input geometry * @returns GEOSGeometry - The shared paths Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSharedPaths_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance. * @param g - The input geometry * @param tolerance - The tolerance to apply. Larger tolerance leads to simpler output. * @returns GEOSGeometry - The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSimplify(g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance. * @param handle - - * @param g - The input geometry * @param tolerance - The tolerance to apply. Larger tolerance leads to simpler output. * @returns GEOSGeometry - The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSimplify_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * @param g - - * @param width - - * @param quadsegs - - * @param joinStyle - - * @param mitreLimit - - * @param leftSide - - * @returns GEOSGeometry - GEOSGeometry */ GEOSSingleSidedBuffer(g: GEOSGeometry, width: number, quadsegs: number, joinStyle: number, mitreLimit: number, leftSide: number): GEOSGeometry; /** * @param handle - - * @param g - - * @param width - - * @param quadsegs - - * @param joinStyle - - * @param mitreLimit - - * @param leftSide - - * @returns GEOSGeometry - GEOSGeometry */ GEOSSingleSidedBuffer_r(handle: GEOSContextHandle_t, g: GEOSGeometry, width: number, quadsegs: number, joinStyle: number, mitreLimit: number, leftSide: number): GEOSGeometry; /** * Snaps the vertices and segments of the first geometry to vertices of the second geometry within the given tolerance. * @param input - An input geometry * @param snap_target - A geometry to snap the input to * @param tolerance - Snapping tolerance * @returns GEOSGeometry - The snapped version of the input. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSnap(input: GEOSGeometry, snap_target: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Snaps the vertices and segments of the first geometry to vertices of the second geometry within the given tolerance. * @param handle - - * @param g1 - An input geometry * @param g2 - A geometry to snap the input to * @param tolerance - Snapping tolerance * @returns GEOSGeometry - The snapped version of the input. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSnap_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Construct an STRtree from items that have been inserted. Once constructed, no more items may be inserted into the tree. Functions that require a constructed tree will build it automatically, so there is no need to call GEOSSTRtree_build unless it is desired to explicitly construct the tree in a certain section of code or using a certain thread. * @param tree - the GEOSSTRtree to apply the build to * @returns number - 1 on success, 0 on error */ GEOSSTRtree_build(tree: GEOSSTRtree): number; /** * Construct an STRtree from items that have been inserted. Once constructed, no more items may be inserted into the tree. Functions that require a constructed tree will build it automatically, so there is no need to call GEOSSTRtree_build unless it is desired to explicitly construct the tree in a certain section of code or using a certain thread. * @param handle - - * @param tree - the GEOSSTRtree to apply the build to * @returns number - 1 on success, 0 on error */ GEOSSTRtree_build_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree): number; /** * Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data. * @param nodeCapacity - The maximum number of child nodes that a node may have. The minimum recommended capacity value is 4. If unsure, use a default node capacity of 10. * @returns GEOSSTRtree - a pointer to the created tree */ GEOSSTRtree_create(nodeCapacity: number): GEOSSTRtree; /** * Create a new GEOSSTRtree using the Sort-Tile-Recursive algorithm (STRtree) for two-dimensional spatial data. * @param handle - - * @param nodeCapacity - The maximum number of child nodes that a node may have. The minimum recommended capacity value is 4. If unsure, use a default node capacity of 10. * @returns GEOSSTRtree - a pointer to the created tree */ GEOSSTRtree_create_r(handle: GEOSContextHandle_t, nodeCapacity: number): GEOSSTRtree; /** * Frees all the memory associated with a GEOSSTRtree. Only the tree is freed. The geometries and items fed into GEOSSTRtree_insert() are not owned by the tree, and are still left to the caller to manage. * @param tree - the GEOSSTRtree to destroy * @returns null - void */ GEOSSTRtree_destroy(tree: GEOSSTRtree): null; /** * Frees all the memory associated with a GEOSSTRtree. Only the tree is freed. The geometries and items fed into GEOSSTRtree_insert() are not owned by the tree, and are still left to the caller to manage. * @param handle - - * @param tree - the GEOSSTRtree to destroy * @returns null - void */ GEOSSTRtree_destroy_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree): null; /** * Insert an item into an GEOSSTRtree * @param tree - the GEOSSTRtree in which the item should be inserted * @param g - a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be copied into the tree and the caller may destroy g while the tree is still in use. Before GEOS 3.9, g must be retained until the tree is destroyed. * @param item - the item to insert into the tree * @returns null - void */ GEOSSTRtree_insert(tree: GEOSSTRtree, g: GEOSGeometry, item: Pointer): null; /** * Insert an item into an GEOSSTRtree * @param handle - - * @param tree - the GEOSSTRtree in which the item should be inserted * @param g - a GEOSGeometry whose envelope corresponds to the extent of 'item'. As of GEOS 3.9, this envelope will be copied into the tree and the caller may destroy g while the tree is still in use. Before GEOS 3.9, g must be retained until the tree is destroyed. * @param item - the item to insert into the tree * @returns null - void */ GEOSSTRtree_insert_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, g: GEOSGeometry, item: Pointer): null; /** * Iterate over all items in the GEOSSTRtree. This will not cause the tree to be constructed. * @param tree - the STRtree over which to iterate * @param callback - a function to be executed for each item in the tree. * @param userdata - payload to pass the callback function. * @returns null - void */ GEOSSTRtree_iterate(tree: GEOSSTRtree, callback: GEOSQueryCallback, userdata: Pointer): null; /** * Iterate over all items in the GEOSSTRtree. This will not cause the tree to be constructed. * @param handle - - * @param tree - the STRtree over which to iterate * @param callback - a function to be executed for each item in the tree. * @param userdata - payload to pass the callback function. * @returns null - void */ GEOSSTRtree_iterate_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, callback: GEOSQueryCallback, userdata: Pointer): null; /** * Returns the nearest item in the GEOSSTRtree to the supplied geometry. All items in the tree MUST be of type GEOSGeometry. If this is not the case, use GEOSSTRtree_nearest_generic() instead. The tree will automatically be constructed if necessary, after which no more items may be added. * @param tree - the GEOSSTRtree to search * @param geom - the geometry with which the tree should be queried * @returns GEOSGeometry - a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in case of exception */ GEOSSTRtree_nearest(tree: GEOSSTRtree, geom: GEOSGeometry): GEOSGeometry; /** * Returns the nearest item in the GEOSSTRtree to the supplied item The tree will automatically be constructed if necessary, after which no more items may be added. * @param tree - the STRtree to search * @param item - the item with which the tree should be queried * @param itemEnvelope - a GEOSGeometry having the bounding box of 'item' * @param distancefn - a function that can compute the distance between two items in the STRtree. The function should return zero in case of error, and should store the computed distance to the location pointed to by the distance argument. The computed distance between two items must not exceed the Cartesian distance between their envelopes. * @param userdata - optional pointer to arbitrary data; will be passed to distancefn each time it is called. * @returns Pointer - a const pointer to the nearest item in the tree to item, or NULL in case of exception */ GEOSSTRtree_nearest_generic(tree: GEOSSTRtree, item: Pointer, itemEnvelope: GEOSGeometry, distancefn: GEOSDistanceCallback, userdata: Pointer): Pointer; /** * Returns the nearest item in the GEOSSTRtree to the supplied item The tree will automatically be constructed if necessary, after which no more items may be added. * @param handle - - * @param tree - the STRtree to search * @param item - the item with which the tree should be queried * @param itemEnvelope - a GEOSGeometry having the bounding box of 'item' * @param distancefn - a function that can compute the distance between two items in the STRtree. The function should return zero in case of error, and should store the computed distance to the location pointed to by the distance argument. The computed distance between two items must not exceed the Cartesian distance between their envelopes. * @param userdata - optional pointer to arbitrary data; will be passed to distancefn each time it is called. * @returns Pointer - a const pointer to the nearest item in the tree to item, or NULL in case of exception */ GEOSSTRtree_nearest_generic_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, item: Pointer, itemEnvelope: GEOSGeometry, distancefn: GEOSDistanceCallback, userdata: Pointer): Pointer; /** * Returns the nearest item in the GEOSSTRtree to the supplied geometry. All items in the tree MUST be of type GEOSGeometry. If this is not the case, use GEOSSTRtree_nearest_generic() instead. The tree will automatically be constructed if necessary, after which no more items may be added. * @param handle - - * @param tree - the GEOSSTRtree to search * @param geom - the geometry with which the tree should be queried * @returns GEOSGeometry - a const pointer to the nearest GEOSGeometry in the tree to 'geom', or NULL in case of exception */ GEOSSTRtree_nearest_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, geom: GEOSGeometry): GEOSGeometry; /** * Query a GEOSSTRtree for items intersecting a specified envelope. The tree will automatically be constructed if necessary, after which no more items may be added. * @param tree - the GEOSSTRtree to search * @param g - a GEOSGeomety from which a query envelope will be extracted * @param callback - a function to be executed for each item in the tree whose envelope intersects the envelope of 'g'. The callback function should take two parameters: a void pointer representing the located item in the tree, and a void userdata pointer. * @param userdata - an optional pointer to pe passed to callback as an argument * @returns null - void */ GEOSSTRtree_query(tree: GEOSSTRtree, g: GEOSGeometry, callback: GEOSQueryCallback, userdata: Pointer): null; /** * Query a GEOSSTRtree for items intersecting a specified envelope. The tree will automatically be constructed if necessary, after which no more items may be added. * @param handle - - * @param tree - the GEOSSTRtree to search * @param g - a GEOSGeomety from which a query envelope will be extracted * @param callback - a function to be executed for each item in the tree whose envelope intersects the envelope of 'g'. The callback function should take two parameters: a void pointer representing the located item in the tree, and a void userdata pointer. * @param userdata - an optional pointer to pe passed to callback as an argument * @returns null - void */ GEOSSTRtree_query_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, g: GEOSGeometry, callback: GEOSQueryCallback, userdata: Pointer): null; /** * Removes an item from the GEOSSTRtree The tree will automatically be constructed if necessary, after which no more items may be added. * @param tree - the STRtree from which to remove an item * @param g - the envelope of the item to remove * @param item - the item to remove * @returns number - 0 if the item was not removed; 1 if the item was removed; 2 if an exception occurred */ GEOSSTRtree_remove(tree: GEOSSTRtree, g: GEOSGeometry, item: Pointer): number; /** * Removes an item from the GEOSSTRtree The tree will automatically be constructed if necessary, after which no more items may be added. * @param handle - - * @param tree - the STRtree from which to remove an item * @param g - the envelope of the item to remove * @param item - the item to remove * @returns number - 0 if the item was not removed; 1 if the item was removed; 2 if an exception occurred */ GEOSSTRtree_remove_r(handle: GEOSContextHandle_t, tree: GEOSSTRtree, g: GEOSGeometry, item: Pointer): number; /** * Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A. * @param ga - geometry A * @param gb - geometry B * @returns GEOSGeometry - A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSymDifference(ga: GEOSGeometry, gb: GEOSGeometry): GEOSGeometry; /** * Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A. * @param handle - - * @param g1 - geometry A * @param g2 - geometry B * @returns GEOSGeometry - A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSymDifference_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param ga - one of the geometries * @param gb - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSymDifferencePrec(ga: GEOSGeometry, gb: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the symmetric difference of two geometries A and B: the set of points that fall in A but not within B and the set of points that fall in B but not in A. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param handle - - * @param g1 - one of the geometries * @param g2 - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the symmetric difference. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSSymDifferencePrec_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance. Returns a valid output geometry, checking for collapses, ring-intersections, etc and attempting to avoid. More computationally expensive than GEOSSimplify() * @param g - The input geometry * @param tolerance - The tolerance to apply. Larger tolerance leads to simpler output. * @returns GEOSGeometry - The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSTopologyPreserveSimplify(g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * Apply the Douglas/Peucker algorithm to the coordinate sequences of the input geometry. Removes "unnecessary" vertices, vertices that are co-linear within the tolerance distance. Returns a valid output geometry, checking for collapses, ring-intersections, etc and attempting to avoid. More computationally expensive than GEOSSimplify() * @param handle - - * @param g - The input geometry * @param tolerance - The tolerance to apply. Larger tolerance leads to simpler output. * @returns GEOSGeometry - The simplified geometry Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSTopologyPreserveSimplify_r(handle: GEOSContextHandle_t, g: GEOSGeometry, tolerance: number): GEOSGeometry; /** * True if geometries share boundaries at one or more points, but do not have interior overlaps. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSTouches(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometries share boundaries at one or more points, but do not have interior overlaps. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSTouches_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area. * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnaryUnion(g: GEOSGeometry): GEOSGeometry; /** * Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area. * @param handle - - * @param g - The input geometry * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnaryUnion_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param g - input geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnaryUnionPrec(g: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the union of all components of a single geometry. Usually used to convert a collection into the smallest set of polygons that cover the same area. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param handle - - * @param g - input geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnaryUnionPrec_r(handle: GEOSContextHandle_t, g: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the union of two geometries A and B: the set of points that fall in A or within B. * @param ga - geometry A * @param gb - geometry B * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnion(ga: GEOSGeometry, gb: GEOSGeometry): GEOSGeometry; /** * Returns the union of two geometries A and B: the set of points that fall in A or within B. * @param handle - - * @param g1 - geometry A * @param g2 - geometry B * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnion_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): GEOSGeometry; /** * @param g - - * @returns GEOSGeometry - GEOSGeometry */ GEOSUnionCascaded(g: GEOSGeometry): GEOSGeometry; /** * @param handle - - * @param g - - * @returns GEOSGeometry - GEOSGeometry */ GEOSUnionCascaded_r(handle: GEOSContextHandle_t, g: GEOSGeometry): GEOSGeometry; /** * Returns the union of two geometries A and B: the set of points that fall in A or within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param ga - one of the geometries * @param gb - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnionPrec(ga: GEOSGeometry, gb: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the union of two geometries A and B: the set of points that fall in A or within B. All the vertices of the output geometry must fall on the grid defined by the gridSize, and the output will be a valid geometry. * @param handle - - * @param g1 - one of the geometries * @param g2 - the other geometry * @param gridSize - the cell size of the precision grid * @returns GEOSGeometry - A newly allocated geometry of the union. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSUnionPrec_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry, gridSize: number): GEOSGeometry; /** * Returns the current GEOS version string. eg: "3.10.0" This function does not have a reentrant variant and is available if GEOS_USE_ONLY_R_API is defined. * @returns string - version string */ GEOSversion(): string; /** * Returns the Voronoi polygons or edges of the vertices of the given geometry. * @param g - the input geometry whose vertices will be used as sites. * @param env - snapping tolerance to use for improved robustness. A tolerance of 0.0 specifies that no snapping will take place. This argument can be finicky and is known to cause the algorithm to fail in several cases. If you're using tolerance and getting a failure, try setting it to 0.0. * @param tolerance - A value from the GEOSVoronoiFlags enum * @param flags - clipping envelope for the returned diagram, automatically determined if env is NULL. The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSVoronoiDiagram(g: GEOSGeometry, env: GEOSGeometry, tolerance: number, flags: number): GEOSGeometry; /** * Returns the Voronoi polygons or edges of the vertices of the given geometry. * @param extHandle - - * @param g - the input geometry whose vertices will be used as sites. * @param env - snapping tolerance to use for improved robustness. A tolerance of 0.0 specifies that no snapping will take place. This argument can be finicky and is known to cause the algorithm to fail in several cases. If you're using tolerance and getting a failure, try setting it to 0.0. * @param tolerance - A value from the GEOSVoronoiFlags enum * @param flags - clipping envelope for the returned diagram, automatically determined if env is NULL. The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites. * @returns GEOSGeometry - A newly allocated geometry. NULL on exception. Caller is responsible for freeing with GEOSGeom_destroy(). */ GEOSVoronoiDiagram_r(extHandle: GEOSContextHandle_t, g: GEOSGeometry, env: GEOSGeometry, tolerance: number, flags: number): GEOSGeometry; /** * True if geometry g1 is completely within g2, and not touching the boundary of g2. * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSWithin(g1: GEOSGeometry, g2: GEOSGeometry): number; /** * True if geometry g1 is completely within g2, and not touching the boundary of g2. * @param handle - - * @param g1 - Input geometry * @param g2 - Input geometry * @returns number - 1 on true, 0 on false, 2 on exception */ GEOSWithin_r(handle: GEOSContextHandle_t, g1: GEOSGeometry, g2: GEOSGeometry): number; /** * Allocate a new GEOSWKBReader. * @returns GEOSWKBReader - a new reader. Caller must free with GEOSWKBReader_destroy() */ GEOSWKBReader_create(): GEOSWKBReader; /** * Allocate a new GEOSWKBReader. * @param handle - - * @returns GEOSWKBReader - a new reader. Caller must free with GEOSWKBReader_destroy() */ GEOSWKBReader_create_r(handle: GEOSContextHandle_t): GEOSWKBReader; /** * Free the memory associated with a GEOSWKBReader. * @param reader - The reader to destroy. * @returns null - void */ GEOSWKBReader_destroy(reader: GEOSWKBReader): null; /** * Free the memory associated with a GEOSWKBReader. * @param handle - - * @param reader - The reader to destroy. * @returns null - void */ GEOSWKBReader_destroy_r(handle: GEOSContextHandle_t, reader: GEOSWKBReader): null; /** * Read a geometry from a well-known binary buffer. * @param reader - A GEOSWKBReader * @param wkb - A pointer to the buffer to read from * @param size - The number of bytes of data in the buffer * @returns GEOSGeometry - A GEOSGeometry built from the WKB, or NULL on exception. */ GEOSWKBReader_read(reader: GEOSWKBReader, wkb: Pointer, size: number): GEOSGeometry; /** * Read a geometry from a well-known binary buffer. * @param handle - - * @param reader - A GEOSWKBReader * @param wkb - A pointer to the buffer to read from * @param size - The number of bytes of data in the buffer * @returns GEOSGeometry - A GEOSGeometry built from the WKB, or NULL on exception. */ GEOSWKBReader_read_r(handle: GEOSContextHandle_t, reader: GEOSWKBReader, wkb: Pointer, size: number): GEOSGeometry; /** * Read a geometry from a hex encoded well-known binary buffer. * @param reader - A GEOSWKBReader * @param hex - A pointer to the buffer to read from * @param size - The number of bytes of data in the buffer * @returns GEOSGeometry - A GEOSGeometry built from the HEX WKB, or NULL on exception. */ GEOSWKBReader_readHEX(reader: GEOSWKBReader, hex: Pointer, size: number): GEOSGeometry; /** * Read a geometry from a hex encoded well-known binary buffer. * @param handle - - * @param reader - A GEOSWKBReader * @param hex - A pointer to the buffer to read from * @param size - The number of bytes of data in the buffer * @returns GEOSGeometry - A GEOSGeometry built from the HEX WKB, or NULL on exception. */ GEOSWKBReader_readHEX_r(handle: GEOSContextHandle_t, reader: GEOSWKBReader, hex: Pointer, size: number): GEOSGeometry; /** * Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading. * @param reader - A WKB reader object, caller retains ownership * @param doFix - Set to 1 to repair, 0 for no repair (default). * @returns null - void */ GEOSWKBReader_setFixStructure(reader: GEOSWKBReader, doFix: number): null; /** * Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading. * @param handle - - * @param reader - A WKB reader object, caller retains ownership * @param doFix - Set to 1 to repair, 0 for no repair (default). * @returns null - void */ GEOSWKBReader_setFixStructure_r(handle: GEOSContextHandle_t, reader: GEOSWKBReader, doFix: number): null; /** * Allocate a new GEOSWKBWriter. * @returns GEOSWKBWriter - a new writer. Caller must free with GEOSWKBWriter_destroy() */ GEOSWKBWriter_create(): GEOSWKBWriter; /** * Allocate a new GEOSWKBWriter. * @param handle - - * @returns GEOSWKBWriter - a new writer. Caller must free with GEOSWKBWriter_destroy() */ GEOSWKBWriter_create_r(handle: GEOSContextHandle_t): GEOSWKBWriter; /** * Free the memory associated with a GEOSWKBWriter. * @param writer - The writer to destroy. * @returns null - void */ GEOSWKBWriter_destroy(writer: GEOSWKBWriter): null; /** * Free the memory associated with a GEOSWKBWriter. * @param handle - - * @param writer - The writer to destroy. * @returns null - void */ GEOSWKBWriter_destroy_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter): null; /** * Find whether the writer will use WKB byte order that is big or little endian. The return value is a member of GEOSWKBByteOrders. * @param writer - The writer to read byte order from * @returns number - The current byte order */ GEOSWKBWriter_getByteOrder(writer: GEOSWKBWriter): number; /** * Find whether the writer will use WKB byte order that is big or little endian. The return value is a member of GEOSWKBByteOrders. * @param handle - - * @param writer - The writer to read byte order from * @returns number - The current byte order */ GEOSWKBWriter_getByteOrder_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter): number; /** * Find whether the writer will use WKB that is ISO flavor or "extended" flavor. The flavor determines how extra dimensionality is encoded with the type number, and whether SRID can be included in the WKB. ISO flavor does not support SRID embedding. ISO flavor is "more standard" for 3D output. GEOS can read both flavors. The return value is a member of GEOSWKBFlavors. * @param writer - The writer to read flavor from * @returns number - The current flavor */ GEOSWKBWriter_getFlavor(writer: GEOSWKBWriter): number; /** * Find whether the writer will use WKB that is ISO flavor or "extended" flavor. The flavor determines how extra dimensionality is encoded with the type number, and whether SRID can be included in the WKB. ISO flavor does not support SRID embedding. ISO flavor is "more standard" for 3D output. GEOS can read both flavors. The return value is a member of GEOSWKBFlavors. * @param handle - - * @param writer - The writer to read flavor from * @returns number - The current flavor */ GEOSWKBWriter_getFlavor_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter): number; /** * Read the current SRID embedding value from the writer. * @param writer - The writer to check SRID value on * @returns number - char */ GEOSWKBWriter_getIncludeSRID(writer: GEOSWKBWriter): number; /** * Read the current SRID embedding value from the writer. * @param handle - - * @param writer - The writer to check SRID value on * @returns number - char */ GEOSWKBWriter_getIncludeSRID_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter): number; /** * Read the current output dimension of the writer. Either 2, 3, or 4 dimensions. Return current number of dimensions. * @param writer - The writer to read from. * @returns number - Number of dimensions (2, 3, or 4) */ GEOSWKBWriter_getOutputDimension(writer: GEOSWKBWriter): number; /** * Read the current output dimension of the writer. Either 2, 3, or 4 dimensions. Return current number of dimensions. * @param handle - - * @param writer - The writer to read from. * @returns number - Number of dimensions (2, 3, or 4) */ GEOSWKBWriter_getOutputDimension_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter): number; /** * Set the output byte order of the writer, using a value from GEOSWKBByteOrders enum. * @param writer - The writer to set byte order on * @param byteOrder - Desired byte order * @returns null - void */ GEOSWKBWriter_setByteOrder(writer: GEOSWKBWriter, byteOrder: number): null; /** * Set the output byte order of the writer, using a value from GEOSWKBByteOrders enum. * @param handle - - * @param writer - The writer to set byte order on * @param byteOrder - Desired byte order * @returns null - void */ GEOSWKBWriter_setByteOrder_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, byteOrder: number): null; /** * Set the output flavor of the writer, using a value from GEOSWKBFlavors enum. * @param writer - The writer to set flavor on * @param flavor - Desired flavor * @returns null - void */ GEOSWKBWriter_setFlavor(writer: GEOSWKBWriter, flavor: number): null; /** * Set the output flavor of the writer, using a value from GEOSWKBFlavors enum. * @param handle - - * @param writer - The writer to set flavor on * @param flavor - Desired flavor * @returns null - void */ GEOSWKBWriter_setFlavor_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, flavor: number): null; /** * Specify whether SRID values should be output in WKB. Many WKB readers do not support SRID values, use with caution. * @param writer - The writer to set SRID output on * @param writeSRID - Set to 1 to include SRID, 0 otherwise * @returns null - void */ GEOSWKBWriter_setIncludeSRID(writer: GEOSWKBWriter, writeSRID: number): null; /** * Specify whether SRID values should be output in WKB. Many WKB readers do not support SRID values, use with caution. * @param handle - - * @param writer - The writer to set SRID output on * @param writeSRID - Set to 1 to include SRID, 0 otherwise * @returns null - void */ GEOSWKBWriter_setIncludeSRID_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, writeSRID: number): null; /** * Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4. * @param writer - The writer to read from. * @param newDimension - The dimensionality desired * @returns null - void */ GEOSWKBWriter_setOutputDimension(writer: GEOSWKBWriter, newDimension: number): null; /** * Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4. * @param handle - - * @param writer - The writer to read from. * @param newDimension - The dimensionality desired * @returns null - void */ GEOSWKBWriter_setOutputDimension_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, newDimension: number): null; /** * Write out the WKB representation of a geometry. * @param writer - The GEOSWKBWriter controlling the writing. * @param g - Geometry to convert to WKB * @param size - Pointer to write the size of the final output WKB to * @returns StringPointer - The WKB representation. Caller must free with GEOSFree() */ GEOSWKBWriter_write(writer: GEOSWKBWriter, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * Write out the WKB representation of a geometry. * @param handle - - * @param writer - The GEOSWKBWriter controlling the writing. * @param g - Geometry to convert to WKB * @param size - Pointer to write the size of the final output WKB to * @returns StringPointer - The WKB representation. Caller must free with GEOSFree() */ GEOSWKBWriter_write_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * Write out the hex WKB representation of a geometry. * @param writer - The GEOSWKBWriter controlling the writing. * @param g - Geometry to convert to WKB * @param size - Pointer to write the size of the final output WKB to * @returns StringPointer - The HEX WKB representation. Caller must free with GEOSFree() */ GEOSWKBWriter_writeHEX(writer: GEOSWKBWriter, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * Write out the hex WKB representation of a geometry. * @param handle - - * @param writer - The GEOSWKBWriter controlling the writing. * @param g - Geometry to convert to WKB * @param size - Pointer to write the size of the final output WKB to * @returns StringPointer - The HEX WKB representation. Caller must free with GEOSFree() */ GEOSWKBWriter_writeHEX_r(handle: GEOSContextHandle_t, writer: GEOSWKBWriter, g: GEOSGeometry, size: NumberPointer): StringPointer; /** * Allocate a new GEOSWKTReader. * @returns GEOSWKTReader - a new reader. Caller must free with GEOSWKTReader_destroy() */ GEOSWKTReader_create(): GEOSWKTReader; /** * Allocate a new GEOSWKTReader. * @param handle - - * @returns GEOSWKTReader - a new reader. Caller must free with GEOSWKTReader_destroy() */ GEOSWKTReader_create_r(handle: GEOSContextHandle_t): GEOSWKTReader; /** * Free the memory associated with a GEOSWKTReader. * @param reader - The reader to destroy. * @returns null - void */ GEOSWKTReader_destroy(reader: GEOSWKTReader): null; /** * Free the memory associated with a GEOSWKTReader. * @param handle - - * @param reader - The reader to destroy. * @returns null - void */ GEOSWKTReader_destroy_r(handle: GEOSContextHandle_t, reader: GEOSWKTReader): null; /** * Use a reader to parse the well-known text representation of a geometry, and return an allocated geometry. * @param reader - A WKT reader object, caller retains ownership * @param wkt - The WKT string to parse, caller retains ownership * @returns GEOSGeometry - A GEOSGeometry, caller to free with GEOSGeom_destroy()) */ GEOSWKTReader_read(reader: GEOSWKTReader, wkt: StringPointer): GEOSGeometry; /** * Use a reader to parse the well-known text representation of a geometry, and return an allocated geometry. * @param handle - - * @param reader - A WKT reader object, caller retains ownership * @param wkt - The WKT string to parse, caller retains ownership * @returns GEOSGeometry - A GEOSGeometry, caller to free with GEOSGeom_destroy()) */ GEOSWKTReader_read_r(handle: GEOSContextHandle_t, reader: GEOSWKTReader, wkt: StringPointer): GEOSGeometry; /** * Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading. * @param reader - A WKT reader object, caller retains ownership * @param doFix - Set to 1 to repair, 0 for no repair (default). * @returns null - void */ GEOSWKTReader_setFixStructure(reader: GEOSWKTReader, doFix: number): null; /** * Set the reader to automatically repair structural errors in the input (currently just unclosed rings) while reading. * @param handle - - * @param reader - A WKT reader object, caller retains ownership * @param doFix - Set to 1 to repair, 0 for no repair (default). * @returns null - void */ GEOSWKTReader_setFixStructure_r(handle: GEOSContextHandle_t, reader: GEOSWKTReader, doFix: number): null; /** * Allocate a new GEOSWKTWriter. * @returns GEOSWKTWriter - a new writer. Caller must free with GEOSWKTWriter_destroy() */ GEOSWKTWriter_create(): GEOSWKTWriter; /** * Allocate a new GEOSWKTReader. * @param handle - - * @returns GEOSWKTWriter - a new reader. Caller must free with GEOSWKTReader_destroy() */ GEOSWKTWriter_create_r(handle: GEOSContextHandle_t): GEOSWKTWriter; /** * Free the memory associated with a GEOSWKTWriter. * @param writer - The writer to destroy. * @returns null - void */ GEOSWKTWriter_destroy(writer: GEOSWKTWriter): null; /** * Free the memory associated with a GEOSWKTWriter. * @param handle - - * @param writer - The writer to destroy. * @returns null - void */ GEOSWKTWriter_destroy_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter): null; /** * Reads the current output dimension from a GEOSWKTWriter. * @param writer - A GEOSWKTWriter. * @returns number - The current dimension. */ GEOSWKTWriter_getOutputDimension(writer: GEOSWKTWriter): number; /** * Reads the current output dimension from a GEOSWKTWriter. * @param handle - - * @param writer - A GEOSWKTWriter. * @returns number - The current dimension. */ GEOSWKTWriter_getOutputDimension_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter): number; /** * Sets the format for 3D outputs. The "old 3D" format does not include a Z dimension tag, e.g. "POINT (1 2 3)", except for XYM, e.g. "POINT M (1 2 3)". Geometries with XYZM coordinates do not add any dimensionality tags, e.g. "POINT (1 2 3 4)". * @param writer - A GEOSWKTWriter. * @param useOld3D - True to use the old format, false is the default. * @returns null - void */ GEOSWKTWriter_setOld3D(writer: GEOSWKTWriter, useOld3D: number): null; /** * Sets the format for 3D outputs. The "old 3D" format does not include a Z dimension tag, e.g. "POINT (1 2 3)", except for XYM, e.g. "POINT M (1 2 3)". Geometries with XYZM coordinates do not add any dimensionality tags, e.g. "POINT (1 2 3 4)". * @param handle - - * @param writer - A GEOSWKTWriter. * @param useOld3D - True to use the old format, false is the default. * @returns null - void */ GEOSWKTWriter_setOld3D_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter, useOld3D: number): null; /** * Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4. * @param writer - A GEOSWKTWriter. * @param dim - The dimensionality desired. * @returns null - void */ GEOSWKTWriter_setOutputDimension(writer: GEOSWKTWriter, dim: number): null; /** * Set the output dimensionality of the writer. Either 2, 3, or 4 dimensions. Default since GEOS 3.12 is 4. * @param handle - - * @param writer - A GEOSWKTWriter. * @param dim - The dimensionality desired. * @returns null - void */ GEOSWKTWriter_setOutputDimension_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter, dim: number): null; /** * Sets the number places after the decimal to output in WKT. * @param writer - A GEOSWKTWriter. * @param precision - The desired precision, default 16. * @returns null - void */ GEOSWKTWriter_setRoundingPrecision(writer: GEOSWKTWriter, precision: number): null; /** * Sets the number places after the decimal to output in WKT. * @param handle - - * @param writer - A GEOSWKTWriter. * @param precision - The desired precision, default 16. * @returns null - void */ GEOSWKTWriter_setRoundingPrecision_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter, precision: number): null; /** * Sets the number trimming option on a GEOSWKTWriter. With trim set to 1, the writer will strip trailing 0's from the output coordinates. With 1 (trimming enabled), big and small absolute coordinates will use scientific notation, otherwise positional notation is used; see GEOS_printDouble for details. With 0 (trimming disabled), all coordinates will be padded with 0's out to the rounding precision. Default since GEOS 3.12 is with trim set to 1 for 'on'. * @param writer - A GEOSWKTWriter. * @param trim - The trimming behaviour to set, 1 for 'on', 0 for 'off' * @returns null - void */ GEOSWKTWriter_setTrim(writer: GEOSWKTWriter, trim: number): null; /** * Sets the number trimming option on a GEOSWKTWriter. With trim set to 1, the writer will strip trailing 0's from the output coordinates. With 1 (trimming enabled), big and small absolute coordinates will use scientific notation, otherwise positional notation is used; see GEOS_printDouble for details. With 0 (trimming disabled), all coordinates will be padded with 0's out to the rounding precision. Default since GEOS 3.12 is with trim set to 1 for 'on'. * @param handle - - * @param writer - A GEOSWKTWriter. * @param trim - The trimming behaviour to set, 1 for 'on', 0 for 'off' * @returns null - void */ GEOSWKTWriter_setTrim_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter, trim: number): null; /** * Writes out the well-known text representation of a geometry, using the trim, rounding and dimension settings of the writer. * @param writer - A GEOSWKTWriter. * @param g - Input geometry * @returns StringPointer - A newly allocated string containing the WKT output or NULL on exception. Caller must free with GEOSFree() */ GEOSWKTWriter_write(writer: GEOSWKTWriter, g: GEOSGeometry): StringPointer; /** * Writes out the well-known text representation of a geometry, using the trim, rounding and dimension settings of the writer. * @param handle - - * @param writer - A GEOSWKTWriter. * @param g - Input geometry * @returns StringPointer - A newly allocated string containing the WKT output or NULL on exception. Caller must free with GEOSFree() */ GEOSWKTWriter_write_r(handle: GEOSContextHandle_t, writer: GEOSWKTWriter, g: GEOSGeometry): StringPointer; /** * End is rounded, with end point of original line in the centre of the round cap. */ GEOSBUF_CAP_ROUND(): void; /** * End is flat, with end point of original line at the end of the buffer */ GEOSBUF_CAP_FLAT(): void; /** * End is flat, with end point of original line in the middle of a square enclosing that point */ GEOSBUF_CAP_SQUARE(): void; /** * Join is rounded, essentially each line is terminated in a round cap. Form round corner. */ GEOSBUF_JOIN_ROUND(): void; /** * Join is flat, with line between buffer edges, through the join point. Forms flat corner. */ GEOSBUF_JOIN_MITRE(): void; /** * Join is the point at which the two buffer edges intersect. Forms sharp corner. */ GEOSBUF_JOIN_BEVEL(): void; /** * Point */ GEOS_POINT(): void; /** * Linestring */ GEOS_LINESTRING(): void; /** * Linear ring, used within polygons */ GEOS_LINEARRING(): void; /** * Polygon */ GEOS_POLYGON(): void; /** * Multipoint, a homogeneous collection of points */ GEOS_MULTIPOINT(): void; /** * Multilinestring, a homogeneous collection of linestrings */ GEOS_MULTILINESTRING(): void; /** * Multipolygon, a homogeneous collection of polygons */ GEOS_MULTIPOLYGON(): void; /** * Geometry collection, a heterogeneous collection of geometry */ GEOS_GEOMETRYCOLLECTION(): void; /** * Original method, combines all rings into a set of noded lines and then extracts valid polygons from that linework. */ GEOS_MAKE_VALID_LINEWORK(): void; /** * Structured method, first makes all rings valid then merges shells and subtracts holes from shells to generate valid result. Assumes that holes and shells are correctly categorized. */ GEOS_MAKE_VALID_STRUCTURE(): void; /** * Fraction of input vertices retained */ GEOSHULL_PARAM_VERTEX_RATIO(): void; /** * Ratio of simplified hull area to input area */ GEOSHULL_PARAM_AREA_RATIO(): void; /** * The output is always valid. Collapsed geometry elements (including both polygons and lines) are removed. */ GEOS_PREC_VALID_OUTPUT(): void; /** * Precision reduction is performed pointwise. Output geometry may be invalid due to collapse or self-intersection. (This might be better called "GEOS_PREC_POINTWISE" - the current name is historical.) */ GEOS_PREC_NO_TOPO(): void; /** * Like the default mode, except that collapsed linear geometry elements are preserved. Collapsed polygonal input elements are removed. */ GEOS_PREC_KEEP_COLLAPSED(): void; /** * See geos::algorithm::BoundaryNodeRule::getBoundaryRuleMod2() */ GEOSRELATE_BNR_MOD2(): void; /** * Same as GEOSRELATE_BNR_MOD2 */ GEOSRELATE_BNR_OGC(): void; /** * See geos::algorithm::BoundaryNodeRule::getBoundaryEndPoint() */ GEOSRELATE_BNR_ENDPOINT(): void; /** * See geos::algorithm::BoundaryNodeRule::getBoundaryMultivalentEndPoint() */ GEOSRELATE_BNR_MULTIVALENT_ENDPOINT(): void; /** * See geos::algorithm::BoundaryNodeRule::getBoundaryMonovalentEndPoint() */ GEOSRELATE_BNR_MONOVALENT_ENDPOINT(): void; /** * Allow self-touching rings to form a hole in a polygon. */ GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE(): void; /** * Return only edges of the Voronoi cells, as a MultiLineString */ GEOS_VORONOI_ONLY_EDGES(): void; /** * Preserve order of inputs, such that the nth cell in the result corresponds to the nth vertex in the input. If this cannot be done, such as for inputs that contain repeated points, GEOSVoronoiDiagram will return NULL. */ GEOS_VORONOI_PRESERVE_ORDER(): void; /** * Big Endian */ GEOS_WKB_XDR(): void; /** * Little Endian */ GEOS_WKB_NDR(): void; /** * Extended */ GEOS_WKB_EXTENDED(): void; /** * ISO */ GEOS_WKB_ISO(): void; Module: Module; } interface Config { /** * If autoInit is true, the GEOS library will be initialized when the geos object is created. * @default true */ autoInit?: boolean; errorHandler?: (message: string) => void; noticeHandler?: (message: string) => void; } declare module 'geos-wasm' { export default function initGeosJs(config?: Config): Promise; }