- #1957, ST_Distance to a one-point LineString returns NULL
- #1976, Geography point-in-ring code overhauled for more reliability
- #1981, cleanup of unused variables causing warnings with gcc 4.6+
+ - #1996, support POINT EMPTY in GeoJSON output
- #2026, improve performance of distance calculations
- #2057, Fixed linking issue for raster2psql to libpq
- #2077, Fixed incorrect values returning from ST_Hillshade()
size += sizeof("{'type':'Point',");
size += sizeof("'coordinates':}");
+ if ( lwpoint_is_empty(point) )
+ size += 2; /* [] */
+
if (srs) size += asgeojson_srs_size(srs);
if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(point->flags), precision);
if (bbox) ptr += asgeojson_bbox_buf(ptr, bbox, FLAGS_GET_Z(point->flags), precision);
ptr += sprintf(ptr, "\"coordinates\":");
+ if ( lwpoint_is_empty(point) )
+ ptr += sprintf(ptr, "[]");
ptr += pointArray_to_geojson(point->point, ptr, precision);
ptr += sprintf(ptr, "}");
-- #1978 --
SELECT '#1978', round(ST_Length(ST_GeomFromText('CIRCULARSTRING(0 0,1 0,0 0)',0))::numeric,4);
+-- #1996 --
+SELECT '#1996', ST_AsGeoJSON(ST_GeomFromText('POINT EMPTY'));
+
-- Clean up
DELETE FROM spatial_ref_sys;
ERROR: invalid GML representation
#1957|1
#1978|3.1413
+#1996|{"type":"Point","coordinates":[]}