Exemple #1
0
        public IEnumerable <int> SpatialIndexScanSearchDistance(SearchDistanceSpecification definition)
        {
            #region initial checks

            if (definition == null)
            {
                throw new ArgumentNullException("definition");
            }

            #endregion

            AGraphElement graphElement;
            if (_fallen8.TryGetGraphElement(out graphElement, definition.GraphElementId))
            {
                IIndex idx;
                if (_fallen8.IndexFactory.TryGetIndex(out idx, definition.IndexId))
                {
                    var spatialIndex = idx as ISpatialIndex;
                    if (spatialIndex != null)
                    {
                        ReadOnlyCollection <AGraphElement> result;
                        return(spatialIndex.SearchDistance(out result, definition.Distance, graphElement)
                            ? result.Select(_ => _.Id)
                            : null);
                    }
                    Logger.LogError(String.Format("The index with id {0} is no spatial index.", definition.IndexId));
                    return(null);
                }
                Logger.LogError(String.Format("Could not find index {0}.", definition.IndexId));
                return(null);
            }
            Logger.LogError(String.Format("Could not find graph element {0}.", definition.GraphElementId));
            return(null);
        }
        public void SpatialIndexScanSearchDistanceIntegrationTest()
        {
            Assert.Inconclusive("TODO.");

            IGraphService target = CreateIGraphService();  // TODO: Initialize to an appropriate value
            SearchDistanceSpecification definition = null; // TODO: Initialize to an appropriate value
            IEnumerable <int>           expected   = null; // TODO: Initialize to an appropriate value
            IEnumerable <int>           actual;

            actual = target.SpatialIndexScanSearchDistance(definition);
            Assert.AreEqual(expected, actual);
        }
        public void SpatialIndexScanSearchDistanceUnitTest()
        {
            Assert.Inconclusive("TODO");

            Fallen8 fallen8 = null;                        // TODO: Initialize to an appropriate value
            var     target  = new GraphService(fallen8);   // TODO: Initialize to an appropriate value
            SearchDistanceSpecification definition = null; // TODO: Initialize to an appropriate value
            IEnumerable <int>           expected   = null; // TODO: Initialize to an appropriate value
            IEnumerable <int>           actual;

            actual = target.SpatialIndexScanSearchDistance(definition);
            Assert.AreEqual(expected, actual);
        }