Callback function sent into the GetGeomCache generic caching system.
Given a LWGEOM* this function builds and stores an RTREE_POLY_CACHE into the provided GeomCache object.
Definition at line 316 of file lwgeom_rtree.c.
References LWMPOLY::geoms, RTreeGeomCache::index, LW_FAILURE, LW_SUCCESS, lwalloc(), MULTIPOLYGONTYPE, LWMPOLY::ngeoms, LWPOLY::nrings, RTREE_POLY_CACHE::polyCount, POLYGONTYPE, r, RTREE_POLY_CACHE::ringCounts, RTREE_POLY_CACHE::ringIndices, LWPOLY::rings, RTreeCacheCreate(), RTreeCreate(), and LWGEOM::type.
328 if ( rtree_cache->
index )
330 lwpgerror(
"RTreeBuilder asked to build index where one already exists.");
336 POSTGIS_DEBUG(2,
"RTreeBuilder MULTIPOLYGON");
345 for ( i = 0; i < mpoly->
ngeoms; i++ )
356 for ( p = 0; p < mpoly->
ngeoms; p++ )
364 rtree_cache->
index = currentCache;
368 POSTGIS_DEBUG(2,
"RTreeBuilder POLYGON");
378 for ( i = 0; i < poly->
nrings; i++ )
382 rtree_cache->
index = currentCache;
387 lwpgerror(
"RTreeBuilder got asked to build index on non-polygon");
The following struct and methods are used for a 1D RTree implementation, described at: http://lin-ear...
The tree structure used for fast P-i-P tests by point_in_multipolygon_rtree()
static RTREE_NODE * RTreeCreate(POINTARRAY *pointArray)
Creates an rtree given a pointer to the point array.
static RTREE_POLY_CACHE * RTreeCacheCreate()
Allocate a fresh clean RTREE_POLY_CACHE.
void * lwalloc(size_t size)
RTREE_NODE ** ringIndices