Distance.Parse does not parse values that have a negative sign, even though negative distances are valid when specifying a distance with a double value and a unit.
Distance.Parse("5m");
This returns a distance unit of 5 meters.
Distance.Parse("-5m");
This returns a distance unit of 0 meters.
new Distance(-5, DistanceUnit.Feet);
This returns a distance unit of -5 meters.
I don't know if this is related to this bug: https://dotspatial.codeplex.com/workitem/24937. Even if not, I guess the .Parse function got some changes but I am stuck on 1.6 and cannot test if this behavior has changed. I thought I should post this anyway incase it needs additional changes before 1.7 gets released.
The reason I'm using negative distance is because I use the Distance unit for Elevation/Altitude, and there are some spots where you need to use negative elevation.
Distance.Parse("5m");
This returns a distance unit of 5 meters.
Distance.Parse("-5m");
This returns a distance unit of 0 meters.
new Distance(-5, DistanceUnit.Feet);
This returns a distance unit of -5 meters.
I don't know if this is related to this bug: https://dotspatial.codeplex.com/workitem/24937. Even if not, I guess the .Parse function got some changes but I am stuck on 1.6 and cannot test if this behavior has changed. I thought I should post this anyway incase it needs additional changes before 1.7 gets released.
The reason I'm using negative distance is because I use the Distance unit for Elevation/Altitude, and there are some spots where you need to use negative elevation.