Skip to content

Releases: vipera/cheap-ruler-rs

v0.4.0

02 Nov 12:17
781ec54
Compare
Choose a tag to compare

0.4.0 (2023-11-02)

With the 0.4.0 release, the size of the cheap ruler struct has been more than halved, but the ability to change or retrieve the distance unit has been removed.

Feature changes

  • Breaking The methods change_unit, clone_with_unit and distance_unit have been removed. If you need to change the unit of a cheap ruler, you should construct a new instance or multiply resulting distances by a conversion factor.

v0.3.0

17 Mar 14:01
bad846a
Compare
Choose a tag to compare

0.3.0 (2021-03-17)

The 0.3.0 release is a breaking change that makes the entire API type generic,
using num_traits::Float instead of fixed with f64.

Feature changes

  • The CheapRuler struct has been changed to CheapRuler<T> to use the generic
    num_traits::Float trait for floating-point numbers instead of using f64.
    Associated functions that previously operated with f64s have also had their
    argument/return types changed to T.

Misc

  • Added a distance benchmark comparing the performance of cheap ruler's distance
    to geo's haversine and vincenty implementations.

v0.2.0

09 Mar 15:48
Compare
Choose a tag to compare

0.2.0 (2021-03-09)

The 0.2 release is primarily an update from geo-types 0.6 to 0.7.

Misc

  • Breaking: Update to geo-types 0.7, and API changes to go with it:
    • PointOnLine<T> requires T to be std::fmt::Debug as that trait is
      required by the underlying geo_types::Point<T> type.
    • Rect<T> is now implemented only for geo_types::CoordNum, not
      geo_types::CoordinateType. geo_types::CoordinateType is deprecated by
      geo-types.
  • Remove dependency on float_extras. Remainder calculation for point wrapping is
    implemented with IEEE 754 formula.

v0.1.0

02 Dec 17:27
Compare
Choose a tag to compare

0.1.0 (2020-12-02)

New features

  • Adds point_to_segment_distance for calculating the shortest distance from a
    point to a given line segment.
  • Adds change_unit and clone_with_unit methods that allow an existing
    ruler's unit to be changed, and distance_unit to get the current unit used
    by the ruler.

Feature changes

  • along now returns an Option<Point<f64>> to support the case where the
    provided LineString is empty without a panic.
  • area now accepts a single Polygon instead of a slice. The given polygon's
    interiors are subtracted from the area instead of the other elements in the
    polygon slice.
  • buffer_point, buffer_bbox and inside_bbox APIs now take points and
    rectangles by reference instead of by value. Additionally, they accept a
    custom Rect type, not geo_types::Rect, due to that type's invariants
    causing problems when drawing a bounding box that goes over the international
    date line. A convenience From trait is implemented.
  • point_on_line also now returns an Option<PointOnLine<f64>> to support the
    case where an empty LineString is provided.
  • Removed From<(Point<T>, usize, T)> for PointOnLine<T> trait implementation,
    the point_on_line method now directly uses the constructor, which is saner.

Bug fixes

  • buffer_bbox now returns correct results for a box crossing the international
    date line.

Misc

  • Adds test coverage for all methods based on mapbox/cheap-ruler and
    mapbox/cheap-ruler-cpp implementations.
  • Adds the project to github workflows with cargo clippy and fmt as additional
    test steps.
  • Use lat and lng methods on geo_types::Point instead of x and y for
    context.