I have an application in which users can upload a shapefile which is then converted to WKT in C# and saved to the database. I'm using DotSpatial for this purpose. In this case, I can use the following code and then proceed to do what I want:
IFeatureSet fs = FeatureSet.OpenFile("C://MyShapefile.shp");
for (int i = 0; i < fs.NumRows(); i++)
{
string wkt = fs.GetShape(i, true).ToGeometry().ToString();
}
However, I would like to be able to upload a zipped shapefile directly and work with it, without having to extract it and only upload the .shp file.
I have looked around about this, but haven't managed to find anything that does what I want. Is it possible to maybe just read the shapefile data from a stream while extracting the zip file in code behind? Or is there some other way to do this?