I'm having a problem with the Spatial Index (Grid 1) when I add data to a table. Starting with an empty table, Grid 1 Index is zero (in ArcCatalog), as expected. - I open the database and table, add some data (one row, a polylineZM, with 33 points), close the table and database.
- ArcCatalog now shows that Grid1 index is 1800. If I click Recalculate, it doesn't change, so I presume 1800 is correct.
- Open the database and table, add another row (polylineZM, 42 points), close the table and database.
- Reload in ArcCatalog which now shows both rows, but still says Grid1 index is 1800. Click Recalculate and it changes to 2000. Ie adding the second row with the API did not update the index.
Why does the API update the index when I add the first row, but not the second? Is there an API function I need to call to ensure the index is updated after adding rows?Extracts from the code, showing the relevant functions that I call:
OpenGeodatabase(databasePath, geodatabase);
geodatabase.OpenTable(tableName, table);
table.SetWriteLock();
table.LoadOnlyMode(true);
Row row();
table.CreateRowObject(row);
MultiPartShapeBuffer polyline;
polyline.Setup(shapePolylineZM, 1, ...);
Point* points;
polyline.GetPoints(points);
double* zs;
polyline.GetZs(zs);
double* ms;
polyline.GetMs(ms);
for (...)
{
points->x = ...
points->y = ...
points++;
*zs++ = ...
*ms++ = ...
}
polyline.CalculateExtent();
row.SetGeometry(polyline);
table.Insert(row))
table.LoadOnlyMode(false);
table.FreeWriteLock();
geodatabase.CloseTable(table);
CloseGeodatabase(geodatabase);