Пример #1
0
 private void VerifySpatialSettings(File indexFile, SpaceFillingCurveSettings expectedSettings)
 {
     try
     {
         SpaceFillingCurveSettings settings = SpaceFillingCurveSettingsFactory.fromGBPTree(indexFile, _pageCache, NativeIndexHeaderReader.readFailureMessage);
         assertThat("Should get correct results from header", settings, equalTo(expectedSettings));
     }
     catch (IOException e)
     {
         fail("Failed to read GBPTree header: " + e.Message);
     }
 }
Пример #2
0
 private static LayoutBootstrapper SpatialLayoutFactory(CoordinateReferenceSystem crs)
 {
     return((indexFile, pageCache, meta, targetLayout) =>
     {
         if (targetLayout.Equals(crs.Name))
         {
             MutableBoolean failure = new MutableBoolean(false);
             Function <ByteBuffer, string> onError = byteBuffer =>
             {
                 failure.setTrue();
                 return "";
             };
             SpaceFillingCurveSettings curveSettings = SpaceFillingCurveSettingsFactory.fromGBPTree(indexFile, pageCache, onError);
             if (!failure.Value)
             {
                 return new SpatialLayout(crs, curveSettings.curve());
             }
         }
         return null;
     });
 }
Пример #3
0
            /// <summary>
            /// If we are loading a layout for an existing index, read the settings from the index header, and ignore config settings
            /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: SpatialFileLayout getLayoutForExistingIndex(org.neo4j.io.pagecache.PageCache pageCache) throws java.io.IOException
            internal virtual SpatialFileLayout GetLayoutForExistingIndex(PageCache pageCache)
            {
                SpaceFillingCurveSettings settings = SpaceFillingCurveSettingsFactory.fromGBPTree(IndexFile, pageCache, NativeIndexHeaderReader.readFailureMessage);

                return(new SpatialFileLayout(this, settings));
            }