I am reading in a shape file using to test my code:
var reader = new ShapeDataReader(path);
var bounds = reader.ShapefileBounds;
foreach (var thing in reader.ReadByMBRFilter(bounds))
{
var attrs = thing.Attributes;
var geo = thing.Geometry;
if (geo != null)
{
var coords = geo.Coordinates;
}
}
path is the path to the .shp file. Is this correct? Or should I be using ShapefileDataReader? I've seen examples online of both.
One thing is that I can't figure out how to get the coordinate system via code. I need to project it to WGS84. The srid on the geometry is 0 so I'm not sure how to get the information I need. Do I need to do something special to read the .prj file to get the information I need?
I am reading in a shape file using to test my code:
pathis the path to the.shpfile. Is this correct? Or should I be usingShapefileDataReader? I've seen examples online of both.One thing is that I can't figure out how to get the coordinate system via code. I need to project it to WGS84. The srid on the geometry is 0 so I'm not sure how to get the information I need. Do I need to do something special to read the
.prjfile to get the information I need?