[postgis-users] ST_Estimated_Extent return incorrect result

Paul Ramsey pramsey at opengeo.org
Fri Aug 27 11:41:22 PDT 2010


Estimated extent operates by using the ANALYZE statistics, which are
gathered by sampling. The box returned will always be smaller than the
actual data extent, because the sample is never going to randomly hit
all the extrema records.

Rather than using the statistics, which will return an underdetermined
box, we should probably be top index page, which will return an
overdetermined box, as that seems to meet the use case of the function
better.

There's no consistent way to defeat this problem, I usually just
expand my bounding boxes by 30% and cross my fingers.

P

On Fri, Aug 27, 2010 at 11:27 AM, Denis Rykov <rykovd at gmail.com> wrote:
> 1. psql -h gis-lab.info -U guest -d osm -c "SELECT ST_Extent(the_geom)
> FROM all_bounds"
> return correct result:
>                    st_extent
> -------------------------------------------------
>  BOX(-180 35.1298141384262,180 85.4657795616266)
> (1 row)
>
> 2. psql -h gis-lab.info -U guest -d osm -c "SELECT
> ST_Estimated_Extent('public','all_bounds','the_geom')"
> return incorrect result:
>                     st_estimated_extent
> -------------------------------------------------------------
>  BOX(-98.0144271850586 35.129810333252,180 85.4657821655273)
> (1 row)
>
> Try to use VACUUM ANALYZE - no results.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list