This project is read-only.

FeatureSet.CoordinateType.Z: creating an XYZM shapefile

Feb 26, 2014 at 10:23 PM
Edited Feb 27, 2014 at 1:10 AM
The CoordinateType is not being passed into result:
In FeatureSet.cs:928 add:
result.CoordinateType = CoordinateType;
which fixes the problem.


I am trying to create an XYZM shapefile, but the CoordinateType stays "Regular" although I set the FeatureSet CoordinateType to CoordinateType.Z.

Example code:
            string outfile = @"c:\temp\outfile.shp";
            IFeatureSet fs = new FeatureSet();
            Coordinate c = new Coordinate(10.1, 20.2, 3.3, 4.4);
            IFeature f = new Feature(c);

            fs.CoordinateType = CoordinateType.Z;
            fs.Projection = KnownCoordinateSystems.Geographic.World.WGS1984;
            fs.DataTable.Columns.Add(new DataColumn(("ID"), typeof (int)));

            f = fs.AddFeature(f);

            f.ShapeType = ShapeType.PointZ;

            f.DataRow["ID"] = 1;

            fs.SaveAs(outfile, true);
When I debug saving of the feature to a Shapefile, the Shapefile's CoordinateType is Regular, althoug I've set the FeatureSet CoordinateType to CoordinateType.Z

Am I doing something wrong or is this a known issue? (I saw two similar posts which went unanswered).

Any help or suggestions would be much appreciated.
Marked as answer by waswart on 2/26/2014 at 5:10 PM
Feb 27, 2014 at 5:58 AM
Yes, as you mentioned earlier, it was an issue.
Now it is fixed.