Current constructors for the shapes are error-prone
The current form new(points: Vec<PointType>, parts: Vec<i32>) requires that users properly organize the points in the Vec and that parts array is properly populated.
As no real checks are done, this can lead to wrong shapefile being written.
Current constructors for the shapes are error-prone
The current form
new(points: Vec<PointType>, parts: Vec<i32>)
requires that users properly organize the points in the Vec and that parts array is properly populated. As no real checks are done, this can lead to wrong shapefile being written.We should change constructors to something like:
Constructor could then sort points clock-wise/counter clock-wise to match the ESRI standard and generate the parts array preventing from mistakes.
And maybe we could add Builders.