use of org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache in project neo4j by neo4j.
the class EntityValueIndexCursorTestBase method assertSameDerivedValue.
protected void assertSameDerivedValue(PointValue p1, PointValue p2) {
ConfiguredSpaceFillingCurveSettingsCache settingsFactory = new ConfiguredSpaceFillingCurveSettingsCache(Config.defaults());
SpaceFillingCurveSettings spaceFillingCurveSettings = settingsFactory.forCRS(CoordinateReferenceSystem.WGS84);
SpaceFillingCurve curve = spaceFillingCurveSettings.curve();
assertEquals(curve.derivedValueFor(p1.coordinate()), curve.derivedValueFor(p2.coordinate()));
}
use of org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache in project neo4j by neo4j.
the class SpatialIndexConfigTest method mustAddSpatialConfigToMap.
@Test
void mustAddSpatialConfigToMap() {
Map<String, Value> map = new HashMap<>();
for (CoordinateReferenceSystem crs : CoordinateReferenceSystem.all()) {
Config config = Config.defaults();
SpaceFillingCurveSettings spaceFillingCurveSettings = new ConfiguredSpaceFillingCurveSettingsCache(config).forCRS(crs);
SpatialIndexConfig.addSpatialConfig(map, crs, spaceFillingCurveSettings);
assertNotNull(map.remove(IndexSettingUtil.spatialMinSettingForCrs(crs).getSettingName()));
assertNotNull(map.remove(IndexSettingUtil.spatialMaxSettingForCrs(crs).getSettingName()));
assertTrue(map.isEmpty());
}
}
use of org.neo4j.kernel.impl.index.schema.config.ConfiguredSpaceFillingCurveSettingsCache in project neo4j by neo4j.
the class SpatialIndexConfigTest method mustAddAndExtractSpatialConfigToIndexConfig.
@Test
void mustAddAndExtractSpatialConfigToIndexConfig() {
IndexConfig indexConfig = IndexConfig.empty();
Map<CoordinateReferenceSystem, SpaceFillingCurveSettings> expectedMap = new HashMap<>();
for (CoordinateReferenceSystem crs : CoordinateReferenceSystem.all()) {
Config config = Config.defaults();
SpaceFillingCurveSettings spaceFillingCurveSettings = new ConfiguredSpaceFillingCurveSettingsCache(config).forCRS(crs);
expectedMap.put(crs, spaceFillingCurveSettings);
indexConfig = SpatialIndexConfig.addSpatialConfig(indexConfig, crs, spaceFillingCurveSettings);
}
Map<CoordinateReferenceSystem, SpaceFillingCurveSettings> extractedMap = SpatialIndexConfig.extractSpatialConfig(indexConfig);
assertEquals(expectedMap, extractedMap);
}
Aggregations