GpxTrackPoster icon indicating copy to clipboard operation
GpxTrackPoster copied to clipboard

Circular rings are scaled wrong if no max distance is provided

Open laufhannes opened this issue 2 years ago • 1 comments

I guess this issue exists since 3e297b811532c357d3a79e4480031470fd542384 / #82.

I'm not sure how the unit handling in python works, but in this part max_length is in km if provided as cli argument and in m otherwise. In my example, the division distance / max_length gives 0.00028... kilometer / meter, but it's 0.28... dimensionless when using distance.to_base_units() / max_length.to_base_units().

        min_length = length_range.lower()
        max_length = length_range.upper()
        if self._max_distance:
            max_length = self._max_distance
        assert min_length is not None
        assert max_length is not None
        ring_distance = self._determine_ring_distance(max_length)
        if ring_distance is None:
            return
        distance = ring_distance
        while distance < max_length:
            radius = radius_range.interpolate((distance / max_length).magnitude)

Not sure if there are more lines where this fails (or did I somehow misconfigured my units?).

laufhannes avatar Mar 30 '22 15:03 laufhannes

@laufhannes: should be fixed with #101

lowtower avatar Apr 19 '22 06:04 lowtower