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

◆ ST_AsGeoJsonRow()

Datum ST_AsGeoJsonRow ( PG_FUNCTION_ARGS  )

Definition at line 81 of file lwgeom_out_geojson.c.

82{
83 Datum array = PG_GETARG_DATUM(0);
84 text *geom_column_text = PG_GETARG_TEXT_P(1);
85 int32 maxdecimaldigits = PG_GETARG_INT32(2);
86 bool do_pretty = PG_GETARG_BOOL(3);
87 StringInfo result;
88 char *geom_column = text_to_cstring(geom_column_text);
89 Oid geom_oid = InvalidOid;
90 Oid geog_oid = InvalidOid;
91
92 /* We need to initialize the internal cache to access it later via postgis_oid() */
93 postgis_initialize_cache(fcinfo);
94 geom_oid = postgis_oid(GEOMETRYOID);
95 geog_oid = postgis_oid(GEOGRAPHYOID);
96
97 if (strlen(geom_column) == 0)
98 geom_column = NULL;
99
100 result = makeStringInfo();
101
102 composite_to_geojson(array, geom_column, maxdecimaldigits, result, do_pretty, geom_oid, geog_oid);
103
104 PG_RETURN_TEXT_P(cstring_to_text_with_len(result->data, result->len));
105}
static void composite_to_geojson(Datum composite, char *geom_column_name, int32 maxdecimaldigits, StringInfo result, bool use_line_feeds, Oid geom_oid, Oid geog_oid)
char * text_to_cstring(const text *textptr)
unsigned int int32
Definition shpopen.c:273

References composite_to_geojson(), and text_to_cstring().

Here is the call graph for this function: