Get raw data from shapefile in C#

582 views Asked by At

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.

1

There are 1 answers

0
CAD Developer On

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;