You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am reading in a shape file using to test my code:
varreader=new ShapeDataReader(path);varbounds= reader.ShapefileBounds;foreach(var thing in reader.ReadByMBRFilter(bounds)){varattrs= thing.Attributes;vargeo= thing.Geometry;if(geo!=null){varcoords= 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?
The text was updated successfully, but these errors were encountered:
FWIW, I'm also having this issue. I cannot find the implementation in this repo that looks at the prj stream. I'm guessing that if the shapefile has a custom projection, you won't be able to specify the SRID to NetTopologySuite (as there won't be a standard one).
Assuming no custom projections: you can read in the .prj file, its just stored as a plain old PROJ string which can be used to lookup the SRID. E.g.
I am reading in a shape file using to test my code:
path
is the path to the.shp
file. 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
.prj
file to get the information I need?The text was updated successfully, but these errors were encountered: