When using spatial index no points are shown


I have a 3D point shapefile. When I open it in MW5 nothing is shown, because by default I have enabled 'Create spatial index on load'.
When I uncheck this option the points are shown.

After creating a unit test the problem seems to be with the spatial index indeed.
Loading the shapefile without a spatial index shows the points and after creating the spatial index (even without reloading the shapefile) hides the points.




Jerry Faust
December 28, 2017, 5:48 PM

Stepping through the process, it was determined that the root of the problem was in the streaming of the Shapefile. The bulk load of the RTree takes a stream of the Shapefile as an input parameter. The streaming code was properly handling 2D Point shapes, but not properly handling 3D Point shapes, leaving undefined values which did not satisfy INTERSECTION range checks. This has been resolved.

Paul Meems
December 7, 2017, 3:31 PM

I update the library to v1.9.0 but that didn't solve the problem.
I also ask questions at StackOverflow: https://stackoverflow.com/questions/47698455/libspatialindex-3d-point-shapefile-is-returning-no-data-when-using-spatial-inde

Paul Meems
December 3, 2017, 7:47 PM

I'm debugging the C++ code for hours now and all I've figured out is that it has to do with the shapefile being 3D:

When I convert the shapefile to 2D using:

And open the shapefile I can see the point.

I'll have a more closer look to the index code, the complicating part is that part of the code is in a 3rd party lib libSpatialIndex



Jerry Faust


Paul Meems


Fix versions

Affects versions