PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ST_AsGeoJsonRow()

Datum ST_AsGeoJsonRow ( PG_FUNCTION_ARGS  )

Definition at line 88 of file lwgeom_out_geojson.c.

89 {
90  Datum array = PG_GETARG_DATUM(0);
91  text *geom_column_text = PG_GETARG_TEXT_P(1);
92  int32 maxdecimaldigits = PG_GETARG_INT32(2);
93  bool do_pretty = PG_GETARG_BOOL(3);
94  StringInfo result;
95  char *geom_column = text_to_cstring(geom_column_text);
96  Oid geom_oid = InvalidOid;
97  Oid geog_oid = InvalidOid;
98 
99  /* We need to initialize the internal cache to access it later via postgis_oid() */
100  postgis_initialize_cache();
101  geom_oid = postgis_oid(GEOMETRYOID);
102  geog_oid = postgis_oid(GEOGRAPHYOID);
103 
104  if (strlen(geom_column) == 0)
105  geom_column = NULL;
106 
107  result = makeStringInfo();
108 
109  composite_to_geojson(fcinfo, array, geom_column, maxdecimaldigits, result, do_pretty, geom_oid, geog_oid);
110 
111  PG_RETURN_TEXT_P(cstring_to_text_with_len(result->data, result->len));
112 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
static void composite_to_geojson(FunctionCallInfo fcinfo, Datum composite, char *geom_column_name, int32 maxdecimaldigits, StringInfo result, bool use_line_feeds, Oid geom_oid, Oid geog_oid)
unsigned int int32
Definition: shpopen.c:54

References composite_to_geojson(), and result.

Here is the call graph for this function: