Skip to content
On this page

geos.GEOSDistance ⇒ number

Computes the distance between the closest points of two geometries.

Kind: Exported member
Returns: number - 1 on success, 0 on exception.

ParamTypeDescription
g1numberThe first geometry to measure from.
g2numberThe second geometry to measure to.
distnumberA pointer to a double variable where the distance will be stored.

geos.GEOSDistanceIndexed ⇒ number

Computes the distance between two geometries using an indexed algorithm. Useful when one or both geometries is very large.

Kind: Exported member
Returns: number - 1 on success, 0 on exception.
See: geos::operation::distance::IndexedFacetDistance
Since: 3.7

ParamTypeDescription
g1numberInput geometry pointer.
g2numberInput geometry pointer.
distnumberPointer to be filled in with distance result.

geos.GEOSDistanceIndexed_r ⇒ number

Computes the distance between two geometries using an indexed algorithm. Useful when one or both geometries is very large. This is a thread-safe version of GEOSDistanceIndexed.

Kind: Exported member
Returns: number - 1 on success, 0 on exception.
See: geos::operation::distance::IndexedFacetDistance
Since: 3.7

ParamTypeDescription
handlenumberThe context handle.pointer
g1numberInput geometry pointer.
g2numberInput geometry pointer.
distnumberPointer to be filled in with distance result.

geos.GEOSDistanceWithin ⇒ number

Tests whether two geometries are within a specified distance of each other.

Kind: Exported member
Returns: number - 1 if the geometries are within the distance of each other, 0 if not, or -1 on error.
See: GEOS C header file

ParamTypeDescription
g1numberA pointer to a GEOS geometry object.
g2numberA pointer to another GEOS geometry object.
distancenumberThe distance threshold to test.

geos.GEOSDistanceWithin_r ⇒ number

Checks if two geometries are within a given distance of each other.

Kind: Exported member
Returns: number - A char value that is 1 if the geometries are within distance, 0 if not, or -1 on error.
See: https://libgeos.org/doxygen/geos__c_8h.html#a7a9b0f6a3d3f9f8a5d4e9e7b6f4a5c0d

ParamTypeDescription
handlenumberA pointer to a GEOS context handle.
g1numberA pointer to the first GEOS geometry object.
g2numberA pointer to the second GEOS geometry object.
distancenumberThe distance threshold in units of the coordinate reference system.

geos.GEOSDistance_r ⇒ number

Computes the distance between the closest points of two geometries.

Kind: Exported member
Returns: number - 1 on success, 0 on exception.

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
g1numberThe first geometry to measure from.
g2numberThe second geometry to measure to.
distnumberA pointer to a double variable where the distance will be stored.