use of org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings 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.SpaceFillingCurveSettings 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.SpaceFillingCurveSettings 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);
}
use of org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings in project neo4j by neo4j.
the class GenericNativeIndexProvider method layout.
@Override
GenericLayout layout(IndexDescriptor descriptor, Path storeFile) {
int numberOfSlots = descriptor.schema().getPropertyIds().length;
IndexConfig indexConfig = descriptor.getIndexConfig();
Map<CoordinateReferenceSystem, SpaceFillingCurveSettings> settings = SpatialIndexConfig.extractSpatialConfig(indexConfig);
return new GenericLayout(numberOfSlots, new IndexSpecificSpaceFillingCurveSettings(settings));
}
use of org.neo4j.kernel.impl.index.schema.config.SpaceFillingCurveSettings in project neo4j by neo4j.
the class GenericNativeIndexProvider method completeSpatialConfiguration.
private IndexConfig completeSpatialConfiguration(IndexConfig indexConfig) {
for (CoordinateReferenceSystem crs : CoordinateReferenceSystem.all()) {
SpaceFillingCurveSettings spaceFillingCurveSettings = configuredSettings.forCRS(crs);
indexConfig = SpatialIndexConfig.addSpatialConfig(indexConfig, crs, spaceFillingCurveSettings);
}
return indexConfig;
}
Aggregations