Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File Dotspacial:遍历Shape而不是ShapeRange类型的对象_File_Loops_Gis_Shape - Fatal编程技术网

File Dotspacial:遍历Shape而不是ShapeRange类型的对象

File Dotspacial:遍历Shape而不是ShapeRange类型的对象,file,loops,gis,shape,File,Loops,Gis,Shape,我是使用dotspace库的初学者。要遍历形状文件的内容,我可以使用FeatureSet读取该文件,然后使用fs.ShapeIndices遍历Shaperanges以打印出顶点。现在我也想打印属性,但Shaperage没有给我这个。有没有可能遍历Shape类型的对象,我在那里有这些信息?这是我的代码: IFeatureSet fs = FeatureSet.Open(@"Cabinet.shp"); foreach (ShapeRange shape in fs

我是使用dotspace库的初学者。要遍历形状文件的内容,我可以使用FeatureSet读取该文件,然后使用fs.ShapeIndices遍历Shaperanges以打印出顶点。现在我也想打印属性,但Shaperage没有给我这个。有没有可能遍历Shape类型的对象,我在那里有这些信息?这是我的代码:

        IFeatureSet fs = FeatureSet.Open(@"Cabinet.shp");

        foreach (ShapeRange shape in fs.ShapeIndices)
        {
            foreach (PartRange part in shape.Parts)
            {
                foreach (Vertex vertex in part)
                {
                    if (vertex.X > 0 && vertex.Y > 0)
                    {
                        Console.WriteLine("X:"+vertex.X);
                        Console.WriteLine("Y:" + vertex.Y);
                        //here I want to print attribute values
                    }
                }
            }
        }