You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2022/03/02 17:57:43 UTC

[GitHub] [jena] galbiston commented on pull request #1204: JENA-2289: fix to setup the precomputed geospatial index properly

galbiston commented on pull request #1204:
URL: https://github.com/apache/jena/pull/1204#issuecomment-1057214711


   Is an additional function needed?
   
   `GeoSPARQLConfig.setupSpatialIndex(dataset, spatialIndexPath.toFile());` ultimately goes to `SpatialIndex.buildSpatialIndex(Dataset dataset, String srsURI, File spatialIndexFile)`.
   `buildSpatialIndex` loads the file and if it results in an empty SpatialIndex will then build a new one based on the `dataset`.
   
   ```
   public static SpatialIndex buildSpatialIndex(Dataset dataset, String srsURI, File spatialIndexFile) throws SpatialIndexException {
   
           SpatialIndex spatialIndex = load(spatialIndexFile);
   
           if (spatialIndex.isEmpty()) {
               Collection<SpatialIndexItem> spatialIndexItems = findSpatialIndexItems(dataset, srsURI);
               save(spatialIndexFile, spatialIndexItems, srsURI);
               spatialIndex = new SpatialIndex(spatialIndexItems, srsURI);
               spatialIndex.build();
           }
   
           setSpatialIndex(dataset, spatialIndex);
           return spatialIndex;
       }
   ```
   
   Is the fix not to remove the `if ( ! Files.exists(spatialIndexPath) || Files.size(spatialIndexPath) == 0 )` check?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org