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.
317{
321 int nrings;
324
325 if ( ! cache )
327
328 if ( rtree_cache->
index )
329 {
330 lwpgerror("RTreeBuilder asked to build index where one already exists.");
332 }
333
335 {
336 POSTGIS_DEBUG(2, "RTreeBuilder MULTIPOLYGON");
338 nrings = 0;
339
340
341
345 for ( i = 0; i < mpoly->
ngeoms; i++ )
346 {
349 }
351
352
353
354
355 i = 0;
356 for ( p = 0; p < mpoly->
ngeoms; p++ )
357 {
359 {
361 i++;
362 }
363 }
364 rtree_cache->
index = currentCache;
365 }
367 {
368 POSTGIS_DEBUG(2, "RTreeBuilder POLYGON");
374
375
376
378 for ( i = 0; i < poly->
nrings; i++ )
379 {
381 }
382 rtree_cache->
index = currentCache;
383 }
384 else
385 {
386
387 lwpgerror("RTreeBuilder got asked to build index on non-polygon");
389 }
391}
void * lwalloc(size_t size)
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.
RTREE_NODE ** ringIndices
The tree structure used for fast P-i-P tests by point_in_multipolygon_rtree()
The following struct and methods are used for a 1D RTree implementation, described at: http://lin-ear...
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.