From 4cca22892900ec854dc95262e4f4e6f14e0ee82a Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 22 Oct 2013 16:09:37 -0700 Subject: [PATCH] For #4, return teeny bbox for single-point patches --- pgsql/pc_pgsql.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pgsql/pc_pgsql.c b/pgsql/pc_pgsql.c index fe2392b..44a749f 100644 --- a/pgsql/pc_pgsql.c +++ b/pgsql/pc_pgsql.c @@ -940,6 +940,16 @@ pc_patch_to_geometry_wkb_envelope(const SERIALIZED_PATCH *pa, const PCSCHEMA *sc int has_srid = false; size_t size = 1 + 4 + 4 + 4 + 2*npoints*8; /* endian + type + nrings + npoints + 5 dbl pts */ + /* Bounds! */ + double xmin = pa->bounds.xmin; + double ymin = pa->bounds.ymin; + double xmax = pa->bounds.xmax; + double ymax = pa->bounds.ymax; + + /* Make sure they're slightly bigger than a point */ + if ( xmin == xmax ) xmax += xmax * 0.0000001; + if ( ymin == ymax ) ymax += ymax * 0.0000001; + if ( schema->srid > 0 ) { has_srid = true;