[geos-devel] code for ST_ClosestPoint

Sandro Santilli strk at keybit.net
Wed Nov 13 09:21:42 PST 2013


On Wed, Nov 13, 2013 at 12:45:46PM +0100, Rémi Cura wrote:
> Hey List,
> another question :
> where is the exact code for the function ST_ClosestPoint?

ST_ClosestPoint is implemented in PostGIS, not GEOS:
LWGEOM_closestpointpostgis/lwgeom_functions_basic.c

> It seems that ST_LineInterpolatePoint is always correct, where
> ST_ClosestPoint is sometime wrong.

ST_LineInterpolatePoint is also in PostGIS:
LWGEOM_line_interpolate_point in postgis/lwgeom_functions_analytic.c

How to find out yourself:

Start from postgis.sql, find the signature, then grep the
referenced C function name in postgis/*.c and follow up from there.

--strk;


More information about the geos-devel mailing list