예제 #1
0
        protected override TopologyTestCase GenerateTestCaseWithinExtentCore(RectangleShape extent)
        {
            OutputFeatureLayer.Open();
            firstInputFeatureLayer.Open();
            secondInputFeatureLayer.Open();

            Collection <Feature> outputFeatures       = OutputFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
            Collection <Feature> inputPointFeatures   = null;
            Collection <Feature> inputPolygonFeatures = null;

            if (!LoadingFromShapeFile)
            {
                inputPointFeatures   = firstInputFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
                inputPolygonFeatures = secondInputFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
            }
            else
            {
                ShapeFileFeatureLayer pointShapeFileFeatureLayer = new ShapeFileFeatureLayer(firstShapeFilePathName);
                pointShapeFileFeatureLayer.Open();
                inputPointFeatures = pointShapeFileFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);

                ShapeFileFeatureLayer polygonShapeFileFeatureLayer = new ShapeFileFeatureLayer(secondShapeFilePathName);
                polygonShapeFileFeatureLayer.Open();
                inputPointFeatures = polygonShapeFileFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
            }
            TwoInputLayersTopologyTestCase topologyTestCase = (TwoInputLayersTopologyTestCase)Activator.CreateInstance(GetType());

            foreach (Feature feature in outputFeatures)
            {
                topologyTestCase.OutputFeatureLayer.InternalFeatures.Add(feature);
            }

            foreach (Feature feature in inputPointFeatures)
            {
                topologyTestCase.FirstInputFeatureLayer.InternalFeatures.Add(feature);
            }

            foreach (Feature feature in inputPolygonFeatures)
            {
                topologyTestCase.SecondInputFeatureLayer.InternalFeatures.Add(feature);
            }

            return(topologyTestCase);
        }
        protected override TopologyTestCase GenerateTestCaseWithinExtentCore(RectangleShape extent)
        {
            if (!OutputFeatureLayer.IsOpen)
            {
                OutputFeatureLayer.Open();
            }
            Collection <Feature> outputFeatures = OutputFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
            Collection <Feature> inputFeatures  = null;

            if (!LoadingFromShapeFile)
            {
                if (!InputFeatureLayer.IsOpen)
                {
                    InputFeatureLayer.Open();
                }

                inputFeatures = InputFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
            }
            else
            {
                ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer(ShapePathFileName);
                shapeFileFeatureLayer.Open();
                inputFeatures = shapeFileFeatureLayer.QueryTools.GetFeaturesInsideBoundingBox(extent, ReturningColumnsType.NoColumns);
                shapeFileFeatureLayer.Close();
            }
            OneInputLayerTopologyTestCase topologyTestCase = (OneInputLayerTopologyTestCase)Activator.CreateInstance(GetType());

            foreach (Feature feature in outputFeatures)
            {
                topologyTestCase.OutputFeatureLayer.InternalFeatures.Add(feature);
            }

            foreach (Feature feature in inputFeatures)
            {
                topologyTestCase.InputFeatureLayer.InternalFeatures.Add(feature);
            }

            return(topologyTestCase);
        }