[postgis-devel] [PostGIS] #2124: spatial index on topogeometries

PostGIS trac at osgeo.org
Sun Dec 2 02:21:17 PST 2012


#2124: spatial index on topogeometries
-------------------------+--------------------------------------------------
 Reporter:  robe         |       Owner:  strk         
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.0
Component:  topology     |     Version:  2.0.x        
 Keywords:               |  
-------------------------+--------------------------------------------------
 One of the main stopping points of topogeometries preventing them from
 replacing geometries in cases they should is the lack of a spatial index.

 The main issue unless I am mistaken is unlike a geometry, you can't just
 apply a bounding box index on a topogeometry since the geometry itself is
 not dependent on change of topogeometry.

 However since we do have a relations table that defines what layer, and
 primitive elements a topogeom belongs to (contains), it seems to me we
 should be able to write a trigger against the

 faces,edges, nodes tables that then triggers a rebuild of bbox of
 dependent topogeoms. In theory we don't need to store the bbox anywhere
 since it's stored in the index, we just need to institute a dummy update
 on the topogeom record to force it to rebuild the spatial index record.
 Something as stupid as (in pseudo code syntax) cause I can't remember the
 exact functions


 {{{
 UPDATE table.topo = table.topo
 WHERE Contains(topo, element_changed);

 }}}

 Where the sql statement would be dynamically generated and table.topo
 would be replaced with layers that contain element that has changed.  The
 trigger would be an after trigger on relations, faces, edges, nodes.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2124>
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