Jay
Jay

Reputation: 11

Get raw data from shapefile in C#

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

Answers (1)

CAD Developer
CAD Developer

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

Related Questions