[postgis-devel] [PostGIS] #1018: Bbox search on geography can miss polygons
PostGIS
trac at osgeo.org
Sun Jun 12 03:18:04 PDT 2011
#1018: Bbox search on geography can miss polygons
---------------------+------------------------------------------------------
Reporter: aaime | Owner: pramsey
Type: defect | Status: new
Priority: high | Milestone: PostGIS 1.5.3
Component: postgis | Version: 1.5.X
Keywords: |
---------------------+------------------------------------------------------
The && operator seems to miss polygons in the result set even if the bbox
queried is smaller than a quadrant (no arcs longer than 180°).
To reproduce:
* get this world borders dataset: http://demo.geo-
solutions.it/share/world.tar.bz2
* import into postgis using:
shp2pgsql -G -I -s 4326 world.shp world
* execute this query:
SELECT name FROM "public"."world" WHERE "geog" && ST_GeogFromText('POLYGON
((-33.7060546875 40.25390625, -33.7060546875 66.97265625, 32.5634765625
66.97265625, 32.5634765625 40.25390625, -33.7060546875 40.25390625))')
order by name;
The result should contain both "SPAIN" and "ANDORRA", but it does not.
Just tweaking a little the bbox makes Spain appear, but Andorra is still
missing:
SELECT name FROM "public"."world" WHERE "geog" && ST_GeogFromText('POLYGON
((-33.4423828125 38.671875, -33.4423828125 65.390625, 32.8271484375
65.390625, 32.8271484375 38.671875, -33.4423828125 38.671875))') order by
name;
System information:
- Ubuntu 10.04 64bit
- Postgis 1.5.2 or trunk at revision 7111, both exhibit similar behavior
- queries are run from psql
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/1018>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list