Opened 15 years ago

Closed 15 years ago

#268 closed defect (fixed)

Simple intersection query between geography column and POLYGON geography fails

Reported by: mcayland Owned by: mcayland
Priority: medium Milestone: PostGIS 1.5.0
Component: postgis Version:
Keywords: Cc:

Description

The following basic intersection query, in my view, should just work:

trunk=# explain analyze select count(*) from cities where the_geog && ST_GeographyFromText('POLYGON((-180 -90, -180 90, 180 90, 180 -90, -180 -90))'); ERROR: lwgeom_get_gbox_geodetic: non-geodetic gbox provided

Change History (3)

comment:1 by robe, 15 years ago

This is strange. I think its a bug in the bbox creation than the operator itself that for some reason the bbox being created is a geometry and not geography.

It works fine when I convert a geometry to geography on the fly like so or maybe its not creating a bbox in this case.

explain select count(*) from neighborhoods
 where geography(ST_Transform(the_geom,4326)) && 
ST_GeographyFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'); 

— but doesn't work with below

SELECT name, geography(ST_Transform(the_geom,4326)) As the_geog
INTO nei_geography
FROM neighborhoods ;

explain select count(*) from nei_geography where the_geog && 
ST_GeographyFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'); 

comment:2 by mcayland, 15 years ago

Hmmm it seems to be coming from the index selectivity functions. I seem to remember already putting one fix in there for this already…

comment:3 by mcayland, 15 years ago

Resolution: fixed
Status: newclosed

Righto, it was a missing initialisation bug which is why it worked for me before. Should now be fixed in r4650.

Note: See TracTickets for help on using tickets.