Download O2 Spatial User Manual
Transcript
O2 Engine API : Spatial Index
O2E_PARAMETER
Th e par am eter opaque is in cor r ect .
O2E_INVALIDCOLLECTION
Th e h an dle colHd is in valid or is n ot a h an dle t o a
per sisten t collect ion .
O2E_IS_INDEXED
Th er e is n o spatial in dex for t h is collect ion .
O2E_NOSPACEONDISK
No m or e space on disk .
O2E_PERMISSIONDENIED
Th e h an dle colHd is valid, bu t n o spat ial in dex can be
cr eat ed on a collect ion of ver sion n ed objects.
O2E_ERROR
In t er n al er r or .
Sample
int create_spidx (Handle
o2_Boolean
{
o2_SiArgList
SIOptions;
hdCollection,
indexOnlyContainsPoints)
SIOptions.addArgument ("IndexType",
"RQuadTree");
SIOptions.addArgument ("KeyCoordType", "Integer32");
SIOptions.addArgument ("Dimension",
2);
SIOptions.addArgument ("D1_Min",
0);
SIOptions.addArgument ("D2_Min",
0);
SIOptions.addArgument ("D1_Max",
40000);
SIOptions.addArgument ("D2_Max",
40000);
SIOptions.addArgument ("D1_MinRegionSize",
2);
SIOptions.addArgument ("D2_MinRegionSize",
2);
SIOptions.addArgument ("MaxChildren",
4);
SIOptions.addArgument ("Threshold",
167);
SIOptions.addArgument ("OnlyPoints",
indexOnlyContainsPoints);
return o2x_spatial_index_create (hdCollection, 0, (void*)
&SIOptions);
}
O2Spatial User Manual
75