Hi Murray,
Thanks for reporting this, You are right we didn’t implement the GetBoundingBox for some reasons, I will confirm with our development team for if it is on purpose or a mistake.
Before this, here are two options for it to get the boundingBox:
Option 1:
Collection<Feature> allfeatures = inMemoryGridIsoLineLayer.GetIsoLineFeatures();
RectangleShape boundingBox = ExtentHelper.GetBoundingBoxOfItems(allfeatures);
Option 2:
GridCell[,] gridMatrix = inMemoryGridIsoLineLayer.GridMatrix;
double cellSize = 0;// todo.
int columnCount = gridMatrix.GetLength(0);
int rowCount = gridMatrix.GetLength(1);
double minX = gridMatrix[0, 0].CenterX - cellSize / 2;
double maxY = gridMatrix[0, 0].CenterY + cellSize / 2;
double maxX = gridMatrix[0, 0].CenterX - cellSize / 2 + cellSize * columnCount;
double minY = gridMatrix[0, 0].CenterY + cellSize / 2 - cellSize * rowCount;
RectangleShape gridExtent = new RectangleShape(minX, maxY, maxX, minY);
The option 1 is simple but with some performance loss. As for the option 2, we need to know the cellSize firstly, but as far as I know, when we generate the gridMatrix for ‘inMemoryGridIsoLineLayer’, we have to specify not only the cellSize but the currentExtent in the GridDefinition which is one of the parameters in method “GenerateGridMatrix” like the below:
GridDefinition gridDefinition = new GridDefinition(currentDrawingExtent, cellSize, -9999, wellDepthPointData);
gridCellMatrix = GridFeatureSource.GenerateGridMatrix(gridDefinition, new InverseDistanceWeightedGridInterpolationModel(2, double.MaxValue));
So as you can see the cellsize could be got from "GridDefinition gridDefinition = new GridDefinition(currentDrawingExtent, cellSize, -9999, wellDepthPointData);" and one more interesting thing is CurrentDrawingExtent could also be got from it. So, would you please check if we could use currentDrawingExtent instead of _gridOverlay.Layers[name].GetBoundingBox()?
Hope those would help.
Summer