Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

Created Unassigned: Distance.Parse does not handle negative values [25448]

$
0
0
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.

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>