Skip to content
On this page

geos.GEOSProject ⇒ number

Returns the distance of a point projected on a line from the origin of the line.

Kind: Exported member
Returns: number - The distance of the projected point along the line, or -1 on exception.
See: https://libgeos.org/doxygen/geos__c_8h.html#a557

ParamTypeDescription
linenumberThe GEOSGeometry pointer of the lineal geometry.
pointnumberThe GEOSGeometry pointer of the point geometry.

geos.GEOSProjectNormalized ⇒ number

Returns the distance of point p projected on line g from the origin of g, which must be a lineal geometry. The distance is normalized to the length of g.

Kind: Exported member
Returns: number - The normalized distance of p projected on g, or -1 on error.
See: https://docs.rs/geos-sys/1.0.13/geos_sys/fn.GEOSProjectNormalized.html

ParamTypeDescription
gnumberA pointer to a GEOSGeometry object representing a lineal geometry.
pnumberA pointer to a GEOSGeometry object representing a point.

geos.GEOSProjectNormalized_r ⇒ number

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

Kind: Exported member
Returns: number - The normalized distance of p projected on g, or -1 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.
pnumberA pointer to a GEOSGeometry object representing a point.

geos.GEOSProject_r ⇒ number

Returns the distance of a point projected on a line from the origin of the line, using a reentrant context.

Kind: Exported member
Returns: number - The distance of the projected point along the line, or -1 on exception.
See: https://libgeos.org/doxygen/geos__c_8h_source.html#l00557

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
linenumberThe GEOSGeometry pointer of the lineal geometry.
pointnumberThe GEOSGeometry pointer of the point geometry.