Skip to content

Commit

Permalink
Rebased configurable spatial index search onto 3.4
Browse files Browse the repository at this point in the history
And simplified by separating maxLevels (index creation) setting from
other index search settings, which also reduced the total size of the PR
  • Loading branch information
craigtaverner committed Mar 7, 2018
1 parent 09f3a06 commit 09415fb
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 82 deletions.
Expand Up @@ -37,7 +37,6 @@
import org.neo4j.graphdb.ResourceIterator; import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.helpers.collection.BoundedIterable; import org.neo4j.helpers.collection.BoundedIterable;
import org.neo4j.helpers.collection.Pair; import org.neo4j.helpers.collection.Pair;
import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.index.internal.gbptree.Writer; import org.neo4j.index.internal.gbptree.Writer;
import org.neo4j.internal.kernel.api.InternalIndexState; import org.neo4j.internal.kernel.api.InternalIndexState;
Expand Down Expand Up @@ -94,7 +93,8 @@ public SpatialCRSSchemaIndex( IndexDescriptor descriptor,
FileSystemAbstraction fs, FileSystemAbstraction fs,
SchemaIndexProvider.Monitor monitor, SchemaIndexProvider.Monitor monitor,
RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector,
SpaceFillingCurveConfiguration configuration ) SpaceFillingCurveConfiguration configuration,
int maxLevels )
{ {
this.crs = crs; this.crs = crs;
this.pageCache = pageCache; this.pageCache = pageCache;
Expand All @@ -110,11 +110,11 @@ public SpatialCRSSchemaIndex( IndexDescriptor descriptor,
indexFile = new File( indexDir.directoryForIndex( indexId ), "index-" + indexId ); indexFile = new File( indexDir.directoryForIndex( indexId ), "index-" + indexId );
if ( crs.getDimension() == 2 ) if ( crs.getDimension() == 2 )
{ {
curve = new HilbertSpaceFillingCurve2D( envelopeFromCRS( crs ), configuration.maxLevels() ); curve = new HilbertSpaceFillingCurve2D( envelopeFromCRS( crs ), maxLevels );
} }
else if ( crs.getDimension() == 3 ) else if ( crs.getDimension() == 3 )
{ {
curve = new HilbertSpaceFillingCurve3D( envelopeFromCRS( crs ), configuration.maxLevels() ); curve = new HilbertSpaceFillingCurve3D( envelopeFromCRS( crs ), maxLevels );
} }
else else
{ {
Expand Down
Expand Up @@ -134,7 +134,6 @@ private void startSeekForRange( IndexProgressor.NodeValueClient client, Geometry
double[] from = rangePredicate.from() == null ? completeEnvelope.getMin() : rangePredicate.from().coordinate(); double[] from = rangePredicate.from() == null ? completeEnvelope.getMin() : rangePredicate.from().coordinate();
double[] to = rangePredicate.to() == null ? completeEnvelope.getMax() : rangePredicate.to().coordinate(); double[] to = rangePredicate.to() == null ? completeEnvelope.getMax() : rangePredicate.to().coordinate();
Envelope envelope = new Envelope( from, to ); Envelope envelope = new Envelope( from, to );

List<SpaceFillingCurve.LongRange> ranges = curve.getTilesIntersectingEnvelope( envelope, configuration ); List<SpaceFillingCurve.LongRange> ranges = curve.getTilesIntersectingEnvelope( envelope, configuration );
for ( SpaceFillingCurve.LongRange range : ranges ) for ( SpaceFillingCurve.LongRange range : ranges )
{ {
Expand Down
Expand Up @@ -26,7 +26,10 @@
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;


import org.neo4j.gis.spatial.index.curves.PartialOverlapConfiguration;
import org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration; import org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration;
import org.neo4j.gis.spatial.index.curves.StandardConfiguration;
import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.index.internal.gbptree.GBPTree; import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
import org.neo4j.internal.kernel.api.IndexCapability; import org.neo4j.internal.kernel.api.IndexCapability;
Expand All @@ -38,6 +41,7 @@
import org.neo4j.kernel.api.index.IndexPopulator; import org.neo4j.kernel.api.index.IndexPopulator;
import org.neo4j.kernel.api.index.SchemaIndexProvider; import org.neo4j.kernel.api.index.SchemaIndexProvider;
import org.neo4j.kernel.api.schema.index.IndexDescriptor; import org.neo4j.kernel.api.schema.index.IndexDescriptor;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig; import org.neo4j.kernel.impl.api.index.sampling.IndexSamplingConfig;
import org.neo4j.kernel.impl.index.schema.SpatialCRSSchemaIndex; import org.neo4j.kernel.impl.index.schema.SpatialCRSSchemaIndex;
import org.neo4j.kernel.impl.storemigration.StoreMigrationParticipant; import org.neo4j.kernel.impl.storemigration.StoreMigrationParticipant;
Expand All @@ -58,20 +62,38 @@ public class SpatialFusionSchemaIndexProvider extends SchemaIndexProvider implem
private final RecoveryCleanupWorkCollector recoveryCleanupWorkCollector; private final RecoveryCleanupWorkCollector recoveryCleanupWorkCollector;
private final boolean readOnly; private final boolean readOnly;
private final SpaceFillingCurveConfiguration configuration; private final SpaceFillingCurveConfiguration configuration;
private final int maxLevels;


private Map<Long,Map<CoordinateReferenceSystem,SpatialCRSSchemaIndex>> indexes = new HashMap<>(); private Map<Long,Map<CoordinateReferenceSystem,SpatialCRSSchemaIndex>> indexes = new HashMap<>();


public SpatialFusionSchemaIndexProvider( PageCache pageCache, FileSystemAbstraction fs, public SpatialFusionSchemaIndexProvider( PageCache pageCache, FileSystemAbstraction fs,
IndexDirectoryStructure.Factory directoryStructure, Monitor monitor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, boolean readOnly, IndexDirectoryStructure.Factory directoryStructure, Monitor monitor, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, boolean readOnly,
SpaceFillingCurveConfiguration configuration ) Config config )
{ {
super( SPATIAL_PROVIDER_DESCRIPTOR, 0, directoryStructure ); super( SPATIAL_PROVIDER_DESCRIPTOR, 0, directoryStructure );
this.pageCache = pageCache; this.pageCache = pageCache;
this.fs = fs; this.fs = fs;
this.monitor = monitor; this.monitor = monitor;
this.recoveryCleanupWorkCollector = recoveryCleanupWorkCollector; this.recoveryCleanupWorkCollector = recoveryCleanupWorkCollector;
this.readOnly = readOnly; this.readOnly = readOnly;
this.configuration = configuration; this.configuration = getConfiguredSpaceFillingCurveConfiguration( config );
this.maxLevels = config.get( GraphDatabaseSettings.space_filling_curve_max_levels );
}

private static SpaceFillingCurveConfiguration getConfiguredSpaceFillingCurveConfiguration( Config config )
{
int extraLevels = config.get( GraphDatabaseSettings.space_filling_curve_extra_levels );
double topThreshold = config.get( GraphDatabaseSettings.space_filling_curve_top_threshold );
double bottomThreshold = config.get( GraphDatabaseSettings.space_filling_curve_bottom_threshold );

if ( topThreshold == 0.0 || bottomThreshold == 0.0 )
{
return new StandardConfiguration( extraLevels );
}
else
{
return new PartialOverlapConfiguration( extraLevels, topThreshold, bottomThreshold );
}
} }


@Override @Override
Expand Down Expand Up @@ -171,7 +193,7 @@ public SpatialCRSSchemaIndex get( IndexDescriptor descriptor,
{ {
return indexMap.computeIfAbsent( crs, return indexMap.computeIfAbsent( crs,
crsKey -> new SpatialCRSSchemaIndex( descriptor, directoryStructure(), crsKey, indexId, pageCache, fs, monitor, crsKey -> new SpatialCRSSchemaIndex( descriptor, directoryStructure(), crsKey, indexId, pageCache, fs, monitor,
recoveryCleanupWorkCollector, configuration ) ); recoveryCleanupWorkCollector, configuration, maxLevels ) );
} }


/** /**
Expand Down
Expand Up @@ -85,7 +85,7 @@ public void setup() throws IOException
IndexDirectoryStructure dirStructure = IndexDirectoryStructure.directoriesByProvider( storeDir ).forProvider( SPATIAL_PROVIDER_DESCRIPTOR ); IndexDirectoryStructure dirStructure = IndexDirectoryStructure.directoriesByProvider( storeDir ).forProvider( SPATIAL_PROVIDER_DESCRIPTOR );
descriptor = IndexDescriptorFactory.forLabel( 42, 1337 ); descriptor = IndexDescriptorFactory.forLabel( 42, 1337 );
index = new SpatialCRSSchemaIndex( descriptor, dirStructure, crs, 1L, pageCacheRule.getPageCache( fs ), fs, index = new SpatialCRSSchemaIndex( descriptor, dirStructure, crs, 1L, pageCacheRule.getPageCache( fs ), fs,
SchemaIndexProvider.Monitor.EMPTY, RecoveryCleanupWorkCollector.IMMEDIATE, new StandardConfiguration() ); SchemaIndexProvider.Monitor.EMPTY, RecoveryCleanupWorkCollector.IMMEDIATE, new StandardConfiguration(), 30 );
samplingConfig = mock( IndexSamplingConfig.class ); samplingConfig = mock( IndexSamplingConfig.class );
} }


Expand Down
Expand Up @@ -26,13 +26,13 @@
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;


import org.neo4j.gis.spatial.index.curves.StandardConfiguration;
import org.neo4j.internal.kernel.api.InternalIndexState; import org.neo4j.internal.kernel.api.InternalIndexState;
import org.neo4j.io.fs.FileSystemAbstraction; import org.neo4j.io.fs.FileSystemAbstraction;
import org.neo4j.io.pagecache.PageCache; import org.neo4j.io.pagecache.PageCache;
import org.neo4j.kernel.api.index.SchemaIndexProvider; import org.neo4j.kernel.api.index.SchemaIndexProvider;
import org.neo4j.kernel.api.schema.index.IndexDescriptor; import org.neo4j.kernel.api.schema.index.IndexDescriptor;
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory; import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.index.schema.SpatialCRSSchemaIndex; import org.neo4j.kernel.impl.index.schema.SpatialCRSSchemaIndex;
import org.neo4j.test.rule.RandomRule; import org.neo4j.test.rule.RandomRule;
import org.neo4j.values.storable.CoordinateReferenceSystem; import org.neo4j.values.storable.CoordinateReferenceSystem;
Expand Down Expand Up @@ -64,7 +64,9 @@ public void setup()
mock( FileSystemAbstraction.class ), mock( FileSystemAbstraction.class ),
NONE, NONE,
SchemaIndexProvider.Monitor.EMPTY, SchemaIndexProvider.Monitor.EMPTY,
null, false, new StandardConfiguration() ); null,
false,
Config.defaults() );
indexMap = provider.indexesFor( 0 ); indexMap = provider.indexesFor( 0 );
indexMap.put( CoordinateReferenceSystem.WGS84, mock( SpatialCRSSchemaIndex.class ) ); indexMap.put( CoordinateReferenceSystem.WGS84, mock( SpatialCRSSchemaIndex.class ) );
indexMap.put( CoordinateReferenceSystem.Cartesian, mock( SpatialCRSSchemaIndex.class ) ); indexMap.put( CoordinateReferenceSystem.Cartesian, mock( SpatialCRSSchemaIndex.class ) );
Expand Down
Expand Up @@ -21,9 +21,6 @@


import java.io.File; import java.io.File;


import org.neo4j.gis.spatial.index.curves.PartialOverlapConfiguration;
import org.neo4j.gis.spatial.index.curves.SpaceFillingCurveConfiguration;
import org.neo4j.gis.spatial.index.curves.StandardConfiguration;
import org.neo4j.graphdb.factory.GraphDatabaseSettings; import org.neo4j.graphdb.factory.GraphDatabaseSettings;
import org.neo4j.helpers.Service; import org.neo4j.helpers.Service;
import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector; import org.neo4j.index.internal.gbptree.RecoveryCleanupWorkCollector;
Expand Down Expand Up @@ -92,10 +89,8 @@ public static FusionSchemaIndexProvider newInstance( PageCache pageCache, File s
boolean readOnly = isReadOnly( config, operationalMode ); boolean readOnly = isReadOnly( config, operationalMode );
NumberSchemaIndexProvider nativeProvider = NumberSchemaIndexProvider nativeProvider =
new NumberSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly ); new NumberSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly );

SpaceFillingCurveConfiguration sfcConfig = getConfiguredSpaceFillingCurveConfiguration( config );
SpatialFusionSchemaIndexProvider spatialProvider = SpatialFusionSchemaIndexProvider spatialProvider =
new SpatialFusionSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly, sfcConfig ); new SpatialFusionSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly, config );
TemporalSchemaIndexProvider temporalProvider = TemporalSchemaIndexProvider temporalProvider =
new TemporalSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly ); new TemporalSchemaIndexProvider( pageCache, fs, childDirectoryStructure, monitor, recoveryCleanupWorkCollector, readOnly );
LuceneSchemaIndexProvider luceneProvider = LuceneSchemaIndexProviderFactory.create( fs, childDirectoryStructure, monitor, config, LuceneSchemaIndexProvider luceneProvider = LuceneSchemaIndexProviderFactory.create( fs, childDirectoryStructure, monitor, config,
Expand All @@ -106,23 +101,6 @@ public static FusionSchemaIndexProvider newInstance( PageCache pageCache, File s
spatialProvider, temporalProvider, luceneProvider, new FusionSelector(), DESCRIPTOR, priority, directoriesByProvider( storeDir ), fs ); spatialProvider, temporalProvider, luceneProvider, new FusionSelector(), DESCRIPTOR, priority, directoriesByProvider( storeDir ), fs );
} }


private static SpaceFillingCurveConfiguration getConfiguredSpaceFillingCurveConfiguration( Config config )
{
int extraLevels = config.get( GraphDatabaseSettings.space_filling_curve_extra_levels );
double topThreshold = config.get( GraphDatabaseSettings.space_filling_curve_top_threshold );
double bottomThreshold = config.get( GraphDatabaseSettings.space_filling_curve_bottom_threshold );
int maxLevels = config.get( GraphDatabaseSettings.space_filling_curve_max_levels );

if ( topThreshold == 0.0 || bottomThreshold == 0.0 )
{
return new StandardConfiguration( extraLevels, maxLevels );
}
else
{
return new PartialOverlapConfiguration( extraLevels, maxLevels, topThreshold, bottomThreshold );
}
}

public static IndexDirectoryStructure.Factory subProviderDirectoryStructure( File storeDir ) public static IndexDirectoryStructure.Factory subProviderDirectoryStructure( File storeDir )
{ {
IndexDirectoryStructure parentDirectoryStructure = directoriesByProvider( storeDir ).forProvider( DESCRIPTOR ); IndexDirectoryStructure parentDirectoryStructure = directoriesByProvider( storeDir ).forProvider( DESCRIPTOR );
Expand Down
Expand Up @@ -28,12 +28,12 @@ public class PartialOverlapConfiguration extends StandardConfiguration


public PartialOverlapConfiguration() public PartialOverlapConfiguration()
{ {
this( StandardConfiguration.DEFAULT_EXTRA_LEVELS, StandardConfiguration.DEFAULT_MAX_LEVELS, TOP_THRESHOLD, BOTTOM_THRESHOLD ); this( StandardConfiguration.DEFAULT_EXTRA_LEVELS, TOP_THRESHOLD, BOTTOM_THRESHOLD );
} }


public PartialOverlapConfiguration( int extraLevels, int maxLevels, double topThreshold, double bottomThreshold ) public PartialOverlapConfiguration( int extraLevels, double topThreshold, double bottomThreshold )
{ {
super( extraLevels, maxLevels ); super( extraLevels );
this.topThreshold = topThreshold; this.topThreshold = topThreshold;
this.bottomThreshold = bottomThreshold; this.bottomThreshold = bottomThreshold;
} }
Expand Down
Expand Up @@ -49,9 +49,4 @@ public interface SpaceFillingCurveConfiguration
* @return the size to use when initializing the ArrayList to store ranges. * @return the size to use when initializing the ArrayList to store ranges.
*/ */
int initialRangesListCapacity(); int initialRangesListCapacity();

/**
* The depth of the space filling curves created for indexes.
*/
int maxLevels();
} }
Expand Up @@ -24,7 +24,6 @@
public class StandardConfiguration implements SpaceFillingCurveConfiguration public class StandardConfiguration implements SpaceFillingCurveConfiguration
{ {
public static final int DEFAULT_EXTRA_LEVELS = 1; public static final int DEFAULT_EXTRA_LEVELS = 1;
public static final int DEFAULT_MAX_LEVELS = 1;


/** /**
* After estimating the search ratio, we know the level at which tiles have approximately the same size as * After estimating the search ratio, we know the level at which tiles have approximately the same size as
Expand All @@ -33,20 +32,14 @@ public class StandardConfiguration implements SpaceFillingCurveConfiguration
*/ */
protected int extraLevels; protected int extraLevels;


/**
* Depth of SpaceFillingCurves at creation time.
*/
protected int maxLevels;

public StandardConfiguration() public StandardConfiguration()
{ {
this( DEFAULT_EXTRA_LEVELS, DEFAULT_MAX_LEVELS ); this( DEFAULT_EXTRA_LEVELS );
} }


public StandardConfiguration( int extraLevels, int maxLevels ) public StandardConfiguration( int extraLevels )
{ {
this.extraLevels = extraLevels; this.extraLevels = extraLevels;
this.maxLevels = maxLevels;
} }


/** /**
Expand Down Expand Up @@ -87,10 +80,4 @@ public int initialRangesListCapacity()
// Probably big enough to for the majority of index queries. // Probably big enough to for the majority of index queries.
return 1000; return 1000;
} }

@Override
public int maxLevels()
{
return maxLevels;
}
} }
Expand Up @@ -461,17 +461,17 @@ public void shouldHaveReasonableCoveredArea()
log( "" ); log( "" );
log( formatHeader1 ); log( formatHeader1 );
log( formatHeader2 ); log( formatHeader2 );
for ( SpaceFillingCurveConfiguration config : new SpaceFillingCurveConfiguration[]{new StandardConfiguration( 1, level ), for ( SpaceFillingCurveConfiguration config : new SpaceFillingCurveConfiguration[]{new StandardConfiguration( 1 ),
new StandardConfiguration( 2, level ), new StandardConfiguration( 3, level ), new StandardConfiguration( 4, level ), new StandardConfiguration( 2 ), new StandardConfiguration( 3 ), new StandardConfiguration( 4 ),
new PartialOverlapConfiguration( 1, level, 0.99, 0.1 ), new PartialOverlapConfiguration( 1, level, 0.99, 0.5 ), new PartialOverlapConfiguration( 1, 0.99, 0.1 ), new PartialOverlapConfiguration( 1, 0.99, 0.5 ),
new PartialOverlapConfiguration( 2, level, 0.99, 0.1 ), new PartialOverlapConfiguration( 2, level, 0.99, 0.5 ), new PartialOverlapConfiguration( 2, 0.99, 0.1 ), new PartialOverlapConfiguration( 2, 0.99, 0.5 ),
new PartialOverlapConfiguration( 3, level, 0.99, 0.1 ), new PartialOverlapConfiguration( 3, level, 0.99, 0.5 ), new PartialOverlapConfiguration( 3, 0.99, 0.1 ), new PartialOverlapConfiguration( 3, 0.99, 0.5 ),
new PartialOverlapConfiguration( 4, level, 0.99, 0.1 ), new PartialOverlapConfiguration( 4, level, 0.99, 0.5 )} ) new PartialOverlapConfiguration( 4, 0.99, 0.1 ), new PartialOverlapConfiguration( 4, 0.99, 0.5 )} )
{ {
MonitorDoubleStats areaStats = new MonitorDoubleStats(); MonitorDoubleStats areaStats = new MonitorDoubleStats();
MonitorStats rangeStats = new MonitorStats(); MonitorStats rangeStats = new MonitorStats();
MonitorStats maxDepthStats = new MonitorStats(); MonitorStats maxDepthStats = new MonitorStats();
HilbertSpaceFillingCurve2D curve = new HilbertSpaceFillingCurve2D( envelope, config.maxLevels() ); HilbertSpaceFillingCurve2D curve = new HilbertSpaceFillingCurve2D( envelope, level );


// For differently shaped rectangles // For differently shaped rectangles
for ( double xExtent = minExtent; xExtent <= xmax; xExtent *= extensionFactor ) for ( double xExtent = minExtent; xExtent <= xmax; xExtent *= extensionFactor )
Expand Down Expand Up @@ -667,19 +667,18 @@ public void debugSingle()
@Test @Test
public void shouldGet2DHilbertSearchTilesForCenterRangeAndTraverseToBottom() public void shouldGet2DHilbertSearchTilesForCenterRangeAndTraverseToBottom()
{ {
TraverseToBottomConfiguration configuration = new TraverseToBottomConfiguration();
Envelope envelope = new Envelope( -8, 8, -8, 8 ); Envelope envelope = new Envelope( -8, 8, -8, 8 );
for ( int level = 2; level <= 11; level++ ) // 12 takes 6s, 13 takes 25s, 14 takes 100s, 15 takes over 400s for ( int level = 2; level <= 11; level++ ) // 12 takes 6s, 13 takes 25s, 14 takes 100s, 15 takes over 400s
{ {
TraverseToBottomConfiguration configuration = new TraverseToBottomConfiguration( level ); HilbertSpaceFillingCurve2D curve = new HilbertSpaceFillingCurve2D( envelope, level );
HilbertSpaceFillingCurve2D curve = new HilbertSpaceFillingCurve2D( envelope, configuration.maxLevels() ); double fullTile = curve.getTileWidth( 0, level );
double fullTile = curve.getTileWidth( 0, configuration.maxLevels() );
double halfTile = fullTile / 2.0; double halfTile = fullTile / 2.0;
Envelope centerWithoutOuterRing = new Envelope( envelope.getMin( 0 ) + fullTile + halfTile, envelope.getMax( 0 ) - fullTile - halfTile, Envelope centerWithoutOuterRing = new Envelope( envelope.getMin( 0 ) + fullTile + halfTile, envelope.getMax( 0 ) - fullTile - halfTile,
envelope.getMin( 1 ) + fullTile + halfTile, envelope.getMax( 1 ) - fullTile - halfTile ); envelope.getMin( 1 ) + fullTile + halfTile, envelope.getMax( 1 ) - fullTile - halfTile );
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<SpaceFillingCurve.LongRange> result = curve.getTilesIntersectingEnvelope( centerWithoutOuterRing, configuration, null ); List<SpaceFillingCurve.LongRange> result = curve.getTilesIntersectingEnvelope( centerWithoutOuterRing, configuration, null );
log( "Hilbert query at level " + configuration.maxLevels() + " took " + (System.currentTimeMillis() - start) + "ms to produce " + result.size() + log( "Hilbert query at level " + level + " took " + (System.currentTimeMillis() - start) + "ms to produce " + result.size() + " tiles" );
" tiles" );
assertTiles( result, tilesNotTouchingOuterRing( curve ).toArray( new SpaceFillingCurve.LongRange[0] ) ); assertTiles( result, tilesNotTouchingOuterRing( curve ).toArray( new SpaceFillingCurve.LongRange[0] ) );
} }
} }
Expand Down
Expand Up @@ -23,13 +23,6 @@


public class TraverseToBottomConfiguration implements SpaceFillingCurveConfiguration public class TraverseToBottomConfiguration implements SpaceFillingCurveConfiguration
{ {
private final int maxLevels;

public TraverseToBottomConfiguration( int maxLevels )
{
this.maxLevels = maxLevels;
}

@Override @Override
public boolean stopAtThisDepth( double overlap, int depth, int maxDepth ) public boolean stopAtThisDepth( double overlap, int depth, int maxDepth )
{ {
Expand All @@ -55,10 +48,4 @@ public int initialRangesListCapacity()
// Thus, we can just as well start with a short list. // Thus, we can just as well start with a short list.
return 10; return 10;
} }

@Override
public int maxLevels()
{
return maxLevels;
}
} }

0 comments on commit 09415fb

Please sign in to comment.