PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ ST_AsGeoJsonRow()

Datum ST_AsGeoJsonRow ( PG_FUNCTION_ARGS  )

Definition at line 85 of file lwgeom_out_geojson.c.

86 {
87  Datum array = PG_GETARG_DATUM(0);
88  text *geom_column_text = PG_GETARG_TEXT_P(1);
89  int32 maxdecimaldigits = PG_GETARG_INT32(2);
90  bool do_pretty = PG_GETARG_BOOL(3);
91  StringInfo result;
92  char *geom_column = text_to_cstring(geom_column_text);
93  Oid geom_oid = InvalidOid;
94  Oid geog_oid = InvalidOid;
95 
96  /* We need to initialize the internal cache to access it later via postgis_oid() */
97  postgis_initialize_cache();
98  geom_oid = postgis_oid(GEOMETRYOID);
99  geog_oid = postgis_oid(GEOGRAPHYOID);
100 
101  if (strlen(geom_column) == 0)
102  geom_column = NULL;
103 
104  result = makeStringInfo();
105 
106  composite_to_geojson(fcinfo, array, geom_column, maxdecimaldigits, result, do_pretty, geom_oid, geog_oid);
107 
108  PG_RETURN_TEXT_P(cstring_to_text_with_len(result->data, result->len));
109 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
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: