Hi
When I create and save a geometry like this:
List coordinates = new List();
coordinates.Add(new Coordinate(0, 0));
coordinates.Add(new Coordinate(1, 0));
coordinates.Add(new Coordinate(1, 1));
coordinates.Add(new Coordinate(0, 1));
coordinates.Add(new Coordinate(0, 0));
AttributesTable attributesTable = new AttributesTable();
Polygon polygon = new Polygon(new LinearRing(coordinates.ToArray()));
IList features = new List();
features.Add(new Feature(polygon, attributesTable));
string shapefilePath = @"C:\test";
ShapefileDataWriter writer = new ShapefileDataWriter(shapefilePath) { Header = ShapefileDataWriter.GetHeader(features[0], features.Count) };
writer.Write((System.Collections.IList)features);
The resulting shape file has polygons with Z values, although they are null. In ArcMAP the polygons show as "Polygon ZM". This is not very good for my further processing of the data. How can get it to save it as just normal xy based polygons?
int max = coordinates.Count;
CoordinateArraySequenceFactory factory = CoordinateArraySequenceFactory.Instance;
ICoordinateSequence sequence = factory.Create(max, 2);
for (int i = 0; i < max; i++)
{
sequence.SetOrdinate(i, Ordinate.X, coords[i].X);
sequence.SetOrdinate(i, Ordinate.Y, coords[i].Y);
}
IPolygon polygon = GeometryFactory.Default.CreatePolygon(sequence);