示例#1
0
        protected override TopologyTestCase CloneCore()
        {
            TwoInputLayersTopologyTestCase newObject = (TwoInputLayersTopologyTestCase)Activator.CreateInstance(GetType());

            for (int i = 0; i < Layers.Count; i++)
            {
                for (int j = 0; j < Layers[i].InternalFeatures.Count; j++)
                {
                    newObject.Layers[i].InternalFeatures.Add(Layers[i].InternalFeatures[j]);
                }
            }
            return(newObject);
        }
示例#2
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);
        }