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

◆ asgeojson_multiline_buf()

static size_t asgeojson_multiline_buf ( const LWMLINE mline,
char *  srs,
char *  output,
GBOX bbox,
int  precision 
)
static

Definition at line 469 of file lwout_geojson.c.

470{
471 LWLINE *line;
472 uint32_t i;
473 char *ptr=output;
474
475 ptr += sprintf(ptr, "{\"type\":\"MultiLineString\",");
476 if (srs) ptr += asgeojson_srs_buf(ptr, srs);
477 if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(mline->flags), precision);
478 ptr += sprintf(ptr, "\"coordinates\":[");
479
480 for (i=0; i<mline->ngeoms; i++)
481 {
482 if (i) ptr += sprintf(ptr, ",");
483 ptr += sprintf(ptr, "[");
484 line = mline->geoms[i];
485 ptr += pointArray_to_geojson(line->points, ptr, precision);
486 ptr += sprintf(ptr, "]");
487 }
488
489 ptr += sprintf(ptr, "]}");
490
491 return (ptr - output);
492}
static uint8_t precision
Definition cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:179
static size_t pointArray_to_geojson(POINTARRAY *pa, char *buf, int precision)
static size_t asgeojson_srs_buf(char *output, char *srs)
static size_t asgeojson_bbox_buf(char *output, GBOX *bbox, int hasz, int precision)
POINTARRAY * points
Definition liblwgeom.h:469
lwflags_t flags
Definition liblwgeom.h:535
LWLINE ** geoms
Definition liblwgeom.h:533
uint32_t ngeoms
Definition liblwgeom.h:538

References asgeojson_bbox_buf(), asgeojson_srs_buf(), LWMLINE::flags, FLAGS_GET_Z, LWMLINE::geoms, LWMLINE::ngeoms, pointArray_to_geojson(), LWLINE::points, and precision.

Referenced by asgeojson_geom_buf(), and asgeojson_multiline().

Here is the call graph for this function:
Here is the caller graph for this function: