"EPSG:4326", 0, 0);
}
-
void out_geojson_test_bbox(void)
{
/* Linestring */
"{\"type\":\"MultiPolygon\",\"bbox\":[0,1,10,11],\"coordinates\":[[[[0,1],[2,3],[4,5],[0,1]]],[[[6,7],[8,9],[10,11],[6,7]]]]}",
NULL, 0, 1);
-#if 0
/* GeometryCollection */
do_geojson_test(
- "GEOMETRYCOLLECTION(POINT(0 1),LINESTRING(2 3,4 5))",
- "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
+ "GEOMETRYCOLLECTION(LINESTRING(0 1,-1 3),LINESTRING(2 3,4 5))",
+ "{\"type\":\"GeometryCollection\",\"bbox\":[-1,1,4,5],\"geometries\":[{\"type\":\"LineString\",\"coordinates\":[[0,1],[-1,3]]},{\"type\":\"LineString\",\"coordinates\":[[2,3],[4,5]]}]}",
NULL, 0, 1);
/* Empty GeometryCollection */
"{\"type\":\"GeometryCollection\",\"geometries\":[]}",
NULL, 0, 1);
+#if 0
/* Nested GeometryCollection */
do_geojson_test(
"GEOMETRYCOLLECTION(POINT(0 1),GEOMETRYCOLLECTION(LINESTRING(2 3,4 5)))",
- "{\"type\":\"GeometryCollection\",\"geometries\":[{\"type\":\"Point\",\"coordinates\":[0,1]},]}",
+ "",
NULL, 0, 1);
#endif
}
/**********************************************************************
- * $Id:$
+ * $Id$
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.refractions.net
{
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
- size += asgeojson_inspected_size(subinsp, bbox, precision);
+ size += asgeojson_inspected_size(subinsp, NULL, precision);
lwinspected_release(subinsp);
}
size += sizeof(",") * i;
if (i) ptr += sprintf(ptr, ",");
subgeom = lwgeom_getsubgeometry_inspected(insp, i);
subinsp = lwgeom_inspect(subgeom);
- ptr += asgeojson_inspected_buf(subinsp, ptr, bbox, precision);
+ ptr += asgeojson_inspected_buf(subinsp, ptr, NULL, precision);
lwinspected_release(subinsp);
}
int type = lwgeom_getType(insp->serialized_form[0]);
char *ptr=output;
- /* Compute 3D BBOX on the sub geometry */
- if ( bbox )
- {
- lwfree(bbox);
- bbox = NULL;
- bbox = compute_serialized_box3d(
- lwgeom_getsubgeometry(insp->serialized_form, 0));
- }
-
switch (type)
{
case POINTTYPE: