use of org.neo4j.values.storable.CoordinateReferenceSystem 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.values.storable.CoordinateReferenceSystem 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.values.storable.CoordinateReferenceSystem 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;
}
use of org.neo4j.values.storable.CoordinateReferenceSystem in project neo4j by neo4j.
the class GeometryType method asValue.
@Override
Value asValue(GenericKey state) {
assertHasCoordinates(state);
CoordinateReferenceSystem crs = CoordinateReferenceSystem.get((int) state.long1, (int) state.long2);
return asValue(state, crs, 0);
}
use of org.neo4j.values.storable.CoordinateReferenceSystem in project neo4j by neo4j.
the class IndexSpecificSpaceFillingCurveSettings method fromConfig.
public static IndexSpecificSpaceFillingCurveSettings fromConfig(Config config) {
Map<CoordinateReferenceSystem, SpaceFillingCurveSettings> specificIndexConfigCache = new HashMap<>();
ConfiguredSpaceFillingCurveSettingsCache configuredSettings = new ConfiguredSpaceFillingCurveSettingsCache(config);
for (CoordinateReferenceSystem crs : CoordinateReferenceSystem.all()) {
specificIndexConfigCache.put(crs, configuredSettings.forCRS(crs));
}
return new IndexSpecificSpaceFillingCurveSettings(specificIndexConfigCache);
}
Aggregations