PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ST_MinimumClearanceLine()

Datum ST_MinimumClearanceLine ( PG_FUNCTION_ARGS  )

Definition at line 2615 of file postgis/lwgeom_geos.c.

2616{
2617 GSERIALIZED* input;
2619 GEOSGeometry* input_geos;
2620 GEOSGeometry* result_geos;
2621 int32_t srid;
2622
2623 initGEOS(lwpgnotice, lwgeom_geos_error);
2624
2625 input = PG_GETARG_GSERIALIZED_P(0);
2626 srid = gserialized_get_srid(input);
2627 input_geos = POSTGIS2GEOS(input);
2628 if (!input_geos)
2629 HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
2630
2631 result_geos = GEOSMinimumClearanceLine(input_geos);
2632 GEOSGeom_destroy(input_geos);
2633 if (!result_geos)
2634 HANDLE_GEOS_ERROR("Error computing minimum clearance");
2635
2636 GEOSSetSRID(result_geos, srid);
2637 result = GEOS2POSTGIS(result_geos, LW_FALSE);
2638 GEOSGeom_destroy(result_geos);
2639
2640 PG_FREE_IF_COPY(input, 0);
2641 PG_RETURN_POINTER(result);
2642}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
void lwgeom_geos_error(const char *fmt,...)
#define LW_FALSE
Definition liblwgeom.h:94
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)
GEOSGeometry * POSTGIS2GEOS(const GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)

References GEOS2POSTGIS(), gserialized_get_srid(), HANDLE_GEOS_ERROR, LW_FALSE, lwgeom_geos_error(), POSTGIS2GEOS(), and result.

Here is the call graph for this function: