From: Mark Cave-Ayland Date: Tue, 21 Dec 2004 12:21:45 +0000 (+0000) Subject: Fixed bug in pass 4 where sample boxes were referred as BOXs and not BOX2DFLOAT4... X-Git-Tag: pgis_1_0_0RC1~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=744264a229b104ba4d16c5ac1a1849646830ce34;p=postgis Fixed bug in pass 4 where sample boxes were referred as BOXs and not BOX2DFLOAT4. Also increased SDFACTOR to 3.25 git-svn-id: http://svn.osgeo.org/postgis/trunk@1172 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_estimate.c b/lwgeom/lwgeom_estimate.c index 05419dc64..b455933d9 100644 --- a/lwgeom/lwgeom_estimate.c +++ b/lwgeom/lwgeom_estimate.c @@ -18,7 +18,6 @@ #include #include "postgres.h" -#include "utils/geo_decls.h" #include "executor/spi.h" #include "fmgr.h" #include "parser/parsetree.h" @@ -54,7 +53,7 @@ * SDFACTOR. */ #define USE_STANDARD_DEVIATION 1 -#define SDFACTOR 2 +#define SDFACTOR 3.25 typedef struct GEOM_STATS_T { @@ -1705,12 +1704,12 @@ compute_geometry_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, */ for (i=0; i 2 elog(NOTICE, " feat %d box is %f %f, %f %f", - i, box->high.x, box->high.y, - box->low.x, box->low.y); + i, box->xmax, box->ymax, + box->xmin, box->ymin); #endif /* Find first overlapping column */ - x_idx_min = (box->low.x-geomstats->xmin) / geow * cols; + x_idx_min = (box->xmin-geomstats->xmin) / geow * cols; if (x_idx_min <0) x_idx_min = 0; if (x_idx_min >= cols) x_idx_min = cols-1; /* Find first overlapping row */ - y_idx_min = (box->low.y-geomstats->ymin) / geoh * rows; + y_idx_min = (box->ymin-geomstats->ymin) / geoh * rows; if (y_idx_min <0) y_idx_min = 0; if (y_idx_min >= rows) y_idx_min = rows-1; /* Find last overlapping column */ - x_idx_max = (box->high.x-geomstats->xmin) / geow * cols; + x_idx_max = (box->xmax-geomstats->xmin) / geow * cols; if (x_idx_max <0) x_idx_max = 0; if (x_idx_max >= cols ) x_idx_max = cols-1; /* Find last overlapping row */ - y_idx_max = (box->high.y-geomstats->ymin) / geoh * rows; + y_idx_max = (box->ymax-geomstats->ymin) / geoh * rows; if (y_idx_max <0) y_idx_max = 0; if (y_idx_max >= rows) y_idx_max = rows-1; #if DEBUG_GEOMETRY_STATS > 2 @@ -2026,6 +2025,9 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS) /********************************************************************** * $Log$ + * Revision 1.18 2004/12/21 12:21:45 mcayland + * Fixed bug in pass 4 where sample boxes were referred as BOXs and not BOX2DFLOAT4. Also increased SDFACTOR to 3.25 + * * Revision 1.17 2004/12/17 18:00:33 strk * LWGEOM_gist_joinsel defined for all PG versions *