This example:
var geomFactory = new GeometryFactory();
var features = new List<IFeature>();
var attrTbl = new AttributesTable();
attrTbl.Add("Id", 10);
var coordinates = new Coordinate[2];
coordinates[0] = new Coordinate(123.0, 023.0);
coordinates[1] = new Coordinate(123.0, 100.0);
var mPoint = geomFactory.CreateMultiPointFromCoords(coordinates);
var ft = new Feature(mPoint, attrTbl);
features.Add(ft);
var shpWriter = new ShapefileDataWriter("outShape.shp", geomFactory);
var header = ShapefileDataWriter.GetHeader(features[0], features.Count);
shpWriter.Header = header;
shpWriter.Write(features);
Failes int the last Write call with exception:
System.ArgumentException: Expected geometry that implements 'IPoint', but was 'MultiPoint'
This is because the call from Write to Shapefile.GetShapeType() with the first geometry returns
PointZM bacause the call to GetNonEmptyGeometry uses GetGeometryN() to get the first point in the mulitpoint and returns it.
The function GetNonEmptyGeometry() could return the geometry itself if it is not null in this case or maby Shapefile.GetShapeType() could not use it to filter geometry.
This example: var geomFactory = new GeometryFactory();
Failes int the last Write call with exception: System.ArgumentException: Expected geometry that implements 'IPoint', but was 'MultiPoint'
This is because the call from Write to Shapefile.GetShapeType() with the first geometry returns PointZM bacause the call to GetNonEmptyGeometry uses GetGeometryN() to get the first point in the mulitpoint and returns it.
The function GetNonEmptyGeometry() could return the geometry itself if it is not null in this case or maby Shapefile.GetShapeType() could not use it to filter geometry.