Releases: vipera/cheap-ruler-rs
Releases · vipera/cheap-ruler-rs
v0.4.0
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
anddistance_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
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 toCheapRuler<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
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>
requiresT
to bestd::fmt::Debug
as that trait is
required by the underlyinggeo_types::Point<T>
type.Rect<T>
is now implemented only forgeo_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
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
andclone_with_unit
methods that allow an existing
ruler's unit to be changed, anddistance_unit
to get the current unit used
by the ruler.
Feature changes
along
now returns anOption<Point<f64>>
to support the case where the
providedLineString
is empty without a panic.area
now accepts a singlePolygon
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
andinside_bbox
APIs now take points and
rectangles by reference instead of by value. Additionally, they accept a
customRect
type, notgeo_types::Rect
, due to that type's invariants
causing problems when drawing a bounding box that goes over the international
date line. A convenienceFrom
trait is implemented.point_on_line
also now returns anOption<PointOnLine<f64>>
to support the
case where an emptyLineString
is provided.- Removed
From<(Point<T>, usize, T)> for PointOnLine<T>
trait implementation,
thepoint_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
andlng
methods ongeo_types::Point
instead ofx
andy
for
context.