This project has moved. For the latest updates, please go here.

Invalid Coordinates in ShapePolyLine

Nov 18, 2013 at 9:12 PM
I'm using the Shapefile Reader to parse a shapefile of polylines, but when I tried to load the coordinates into my application, I kept getting errors. So I debugged the coordinates (as seen below) to make sure everything was okay and I got values that were far too large (i.e. "423980.2, 4523003.4" and "424024.4, 4523073.9"). I did a quick conversion over to KML to view the coordinate values and they appear to be perfectly valid coordinates.

Is there anything I'm doing wrong that would cause these values to come through incorrectly?
Shapefile shapefile = new Shapefile(path);

foreach (Shape shape in shapefile)
{
    ShapePolyLine line = shape as ShapePolyLine;

    foreach (PointD[] points in line.Parts)
    {
        foreach (PointD point in points)
        {
            Console.WriteLine(point.X.ToString() + ", " + point.Y.ToString());
        }
    }
}