[postgis-users] 3D spatial index and && 2d operator

Jose Carlos Martinez Llario jomarlla at cgf.upv.es
Thu Dec 29 13:49:12 PST 2011


Dear list,

Im using PostGIS 2.0 trunk r 8612

In order to use 3d spatial index Im using the &&& operator and its 
working well (thanks Paul)  with the following 3d spatial index:
create index p3d_geom_gist on p3d using gist(geom gist_geometry_ops_nd);

but then I noticed that the 2d && operator is not using the 3d spatial 
index  (I confirmed it looking into the postgis.sql file). I can fix it 
creating a second index on the same column like:
create index p3d_geom_gist2d on p3d using gist(geom);

but it seems to me a waste of resources.
I could use &&& operator with a huge z range imitating the && operator 
but I dont like too much  this solution.

Why the gist_geometry_ops_nd operator is not defining the && operator? I 
guess it is because PostgreSQL can not know which one it should apply.
Anyways, this is going to be the expected behavior in the PostGIS 2.0 
final release, I mean should we create two indexes on the same geometry 
column for using && and &&& operators with spatial indexes?

Thanks,

PD: I dont know which is the appropiate list for the trunk PostGIS 
questions, postgis-users or postgis-devel?




More information about the postgis-users mailing list