private IndexInfo createIndexForLayer(String layerName, @Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(layerName, "geom", IndexType.QUADTREE, metadata); return indexInfo; }
private IndexInfo createIndexForLayer(String layerName, @Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(layerName, "geom", IndexType.QUADTREE, metadata); return indexInfo; }
private IndexInfo createIndex(@Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(worldPointsLayer.getName(), "geom", IndexType.QUADTREE, metadata); return indexInfo; }
private IndexInfo createIndex(@Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(worldPointsLayer.getName(), "geom", IndexType.QUADTREE, metadata); return indexInfo; }
private IndexInfo createIndex(@Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(worldPointsLayer.getName(), "geom", IndexType.QUADTREE, metadata); return indexInfo; }
private IndexInfo createIndex(@Nullable String... extraAttributes) { Map<String, Object> metadata = new HashMap<>(); metadata.put(IndexInfo.MD_QUAD_MAX_BOUNDS, new Envelope(-180, 180, -90, 90)); if (extraAttributes != null && extraAttributes.length > 0) { metadata.put(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA, extraAttributes); } IndexInfo indexInfo; indexInfo = indexdb.createIndexInfo(worldPointsLayer.getName(), "geom", IndexType.QUADTREE, metadata); return indexInfo; }
@Test public void testGetIndexesNoneTreeName() { String treeName = "tree"; List<IndexInfo> indexes = indexDb.getIndexInfos(treeName); assertTrue(indexes.isEmpty()); indexDb.createIndexInfo("otherTree", "someAttribute", IndexType.QUADTREE, null); indexes = indexDb.getIndexInfos(treeName); assertTrue(indexes.isEmpty()); }
@Test public void testGetIndexNotPresent() { String treeName = "tree"; String attributeName = "attribute"; Optional<IndexInfo> indexOpt = indexDb.getIndexInfo(treeName, attributeName); assertFalse(indexOpt.isPresent()); indexDb.createIndexInfo("otherTree", "someAttribute", IndexType.QUADTREE, null); indexOpt = indexDb.getIndexInfo(treeName, attributeName); assertFalse(indexOpt.isPresent()); }
@Test public void testGetIndexesNoneTreeName() { String treeName = "tree"; List<IndexInfo> indexes = indexDb.getIndexInfos(treeName); assertTrue(indexes.isEmpty()); indexDb.createIndexInfo("otherTree", "someAttribute", IndexType.QUADTREE, null); indexes = indexDb.getIndexInfos(treeName); assertTrue(indexes.isEmpty()); }
@Test public void testGetIndexNotPresent() { String treeName = "tree"; String attributeName = "attribute"; Optional<IndexInfo> indexOpt = indexDb.getIndexInfo(treeName, attributeName); assertFalse(indexOpt.isPresent()); indexDb.createIndexInfo("otherTree", "someAttribute", IndexType.QUADTREE, null); indexOpt = indexDb.getIndexInfo(treeName, attributeName); assertFalse(indexOpt.isPresent()); }
@Test public void testDropMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(DropIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testBuildFullHistoryMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(BuildFullHistoryIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testDropMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(DropIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testUpdateMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalArgumentException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testBuildFullHistoryMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(BuildFullHistoryIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testUpdateMultipleMatchingIndexes() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); indexdb.createIndexInfo(worldPointsLayer.getName(), "y", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage( "Multiple indexes were found for the specified tree, please specify the attribute."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .call(); }
@Test public void testBuildFullHistoryNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage("A matching index could not be found."); geogig.command(BuildFullHistoryIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }
@Test public void testUpdateNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalArgumentException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }
@Test public void testBuildFullHistoryNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage("A matching index could not be found."); geogig.command(BuildFullHistoryIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }
@Test public void testUpdateNoMatchingIndex() { indexdb.createIndexInfo(worldPointsLayer.getName(), "x", IndexType.QUADTREE, null); exception.expect(IllegalStateException.class); exception.expectMessage("A matching index could not be found."); geogig.command(UpdateIndexOp.class)// .setTreeRefSpec(worldPointsLayer.getName())// .setAttributeName("y")// .call(); }