Closed benabdelkrim closed 3 years ago
I personally don't know Xamarin.Forms in detail, but I assume that you can be sure if there's a bug related to NTS simply adding this BEFORE the code you posted
Debug.WriteLine(Environment.CurrentDirectory)
Debug.Assert(File.Exists("mapsuiSample.MURS.shp"))
ShapeDataReader reader = new ShapeDataReader("mapsuiSample.MURS.shp");
Environment.CurrentDirectory
shows the actual folder path used as a start when you specify a relative path, like the filename "mapsuiSample.MURS.shp" or something like "..\myfolder\myfile"
I personally don't know Xamarin.Forms in detail, but I assume that you can be sure if there's a bug related to NTS simply adding this BEFORE the code you posted
Debug.WriteLine(Environment.CurrentDirectory)
Debug.Assert(File.Exists("mapsuiSample.MURS.shp"))
ShapeDataReader reader = new ShapeDataReader("mapsuiSample.MURS.shp");
Environment.CurrentDirectory
shows the actual folder path used as a start when you specify a relative path, like a filename, so you shall be sure that the file you try to read actually exists where Xamarin expects to be
Debug.WriteLine(Environment.CurrentDirectory) Debug.Assert(File.Exists("mapsuiSample.MURS.shp")) this was helpful for me thank you for your response
i want to read a shapefile but file not existing ? ShapeDataReader reader = new ShapeDataReader("mapsuiSample.MURS.shp"); var mbr = reader.ShapefileBounds; var result = reader.ReadByMBRFilter(mbr); var coll = result.GetEnumerator(); while (coll.MoveNext()) var item = coll.Current;