[postgis-users] "Gist" code doesnt use "R-tree"....??? Why???

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Thu May 3 04:56:53 PDT 2007


On Thu, 2007-05-03 at 20:32 +0900, ?? ? wrote:

> Hi~ Thanks.
> 
> i used "prstgres 8.2.3 and postgis 1.2.1".
> 
> At first, i generated a table, geometry column, spatial index and then 
> inserted point data until those were splitted.
> 
> SQL command using below method.
> 
> CREATE TABLE MAP (name varchar(20));
> SELECT AddGeometryColumn('map','location',423,'POINT',2);
> CREATE INDEX location_idx ON map USING GIST(location);
> INSERT INTO map (name, location) VALUES ('a', GeomFromText('POINT(10 
> 552)',423));
> INSERT INTO map (name, location) VALUES ('b', GeomFromText('POINT(16 
> 4562)',423));
> INSERT INTO map (name, location) VALUES ('c', GeomFromText('POINT(124 
> 562)',423));
> INSERT INTO map (name, location) VALUES ('d', GeomFromText('POINT(1234 
> 452)',423));
> INSERT INTO map (name, location) VALUES ('e', GeomFromText('POINT(13 
> 5672)',423));
> INSERT INTO map (name, location) VALUES ('f', GeomFromText('POINT(15 
> 62)',423));
> 
> As a debugging method, i called the elog function located in c files in 
> /src/backand/access/gist
> to print out the name of function and file when the function was called as 
> the code version of postgres.
> 
> Thanks alot~


Right, I understand now. PostgreSQL has its own internal geometric types
which uses the internal R-Tree implementation in
src/backend/access/gist. In any case, the PostgreSQL geometric types
don't allow you to index points, only polygons, boxes and circles, plus
don't support SRIDs / OGC functions.

What you need to do is set a breakpoint in the GiST methods included
with the PostGIS source in lwgeom/lwgeom_gist.c - these should then
break when you create the index.


HTH,

Mark.





More information about the postgis-users mailing list