Reputation: 11
I want to get a list/array from a shapefile in C#. Like when you use an online shapefile to csv converter but of course not converted in csv but just as an array of strings. I saw some people recommend DotSpatial but I find it very hard to find documentation. I don't want to draw shapes or any other complicated stuff.
Upvotes: 0
Views: 854
Reputation: 1697
In DotSpatial You can easy read data like this:
using DotSpatial.Data;
Shapefile sf = Shapefile.OpenFile(Path);
System.Data.DataTable dt = sf.Attributes.Table;
List<ShapeRange> sr = sf.ShapeIndices;
DotSpatial.Data.IFeatureList features = sf.Features;
Upvotes: 0