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

◆ geometry_to_jsonb()

Datum geometry_to_jsonb ( PG_FUNCTION_ARGS  )

Definition at line 468 of file lwgeom_export.c.

469{
470 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
471 LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
472 char *geojson = lwgeom_to_geojson(lwgeom, NULL, 15, 0);
473 lwgeom_free(lwgeom);
474 PG_RETURN_DATUM(DirectFunctionCall1(jsonb_in, PointerGetDatum(geojson)));
475}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
char * lwgeom_to_geojson(const LWGEOM *geo, char *srs, int precision, int has_bbox)
Takes a GEOMETRY and returns a GeoJson representation.

References lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_to_geojson().

Here is the call graph for this function: