Skip to content
On this page

geos.GEOSInterpolate ⇒ 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.

Kind: Exported member
Returns: number - A new GEOSGeometry pointer representing the interpolated point, or NULL on exception.
See: https://libgeos.org/doxygen/geos__c_8h.html#a1849

ParamTypeDescription
linenumberThe GEOSGeometry pointer of the lineal geometry.
distancenumberThe distance along the linestring to interpolate.

geos.GEOSInterpolateNormalized ⇒ number

Returns the point along line g representing the given distance from the origin along the geometry. The distance is normalized to the length of g, which must be a lineal geometry.

Kind: Exported member
Returns: number - A pointer to a new GEOSGeometry object representing the interpolated point, or NULL on error.
See: https://rdrr.io/cran/geos/man/geos_project.html

ParamTypeDescription
gnumberA pointer to a GEOSGeometry object representing a lineal geometry.
dnumberThe normalized distance along the linestring to interpolate.

geos.GEOSInterpolateNormalized_r ⇒ number

Returns the point along line g representing the given distance from the origin along the geometry. The distance is normalized to the length of g, which must be a lineal geometry. This is a thread-safe variant of GEOSInterpolateNormalized that takes a GEOS context handle as an argument.

Kind: Exported member
Returns: number - A pointer to a new GEOSGeometry object representing the interpolated point, or NULL on error.
See: https://github.com/libgeos/geos/blob/main/capi/geos_c.h.in

ParamTypeDescription
handlenumberA pointer to a GEOSContextHandle_t object.
gnumberA pointer to a GEOSGeometry object representing a lineal geometry.
dnumberThe normalized distance along the linestring to interpolate.

geos.GEOSInterpolate_r ⇒ 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.

Kind: Exported member
Returns: number - A new GEOSGeometry pointer representing the interpolated point, or NULL on exception.
See: https://libgeos.org/doxygen/geos__c_8h.html#a1850

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
linenumberThe GEOSGeometry pointer of the lineal geometry.
distancenumberThe distance along the linestring to interpolate.