Description
Implement BoundingBox as a ValueObject in the geo module.
Spec: composite: SW Coordinate + NE Coordinate
Implementation checklist
Implementation detail
Input / Output
BoundingBox is a composite value object. Depends on Coordinate.
|
Type |
| Input |
BoundingBoxInput { south_west: Coordinate, north_east: Coordinate } |
| Output |
String — e.g. "SW(49.0000, 12.0000) NE(51.0000, 16.0000)" |
Validation
- The south-west latitude must be strictly less than the north-east latitude.
- The south-west longitude must be strictly less than the north-east longitude.
Extra methods
south_west() -> &Coordinate
north_east() -> &Coordinate
contains(coord: &Coordinate) -> bool — returns true if the coordinate falls within the bounding box (inclusive on all edges).
References
Description
Implement
BoundingBoxas aValueObjectin thegeomodule.Spec: composite: SW
Coordinate+ NECoordinateImplementation checklist
src/geo/boundingbox.rsValueObjecttrait#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]src/geo/mod.rsandprelude# ExampleblockROADMAP.mdfrom ⬜ to ✅Implementation detail
Input / Output
BoundingBoxis a composite value object. Depends onCoordinate.BoundingBoxInput { south_west: Coordinate, north_east: Coordinate }String— e.g."SW(49.0000, 12.0000) NE(51.0000, 16.0000)"Validation
Extra methods
south_west() -> &Coordinatenorth_east() -> &Coordinatecontains(coord: &Coordinate) -> bool— returnstrueif the coordinate falls within the bounding box (inclusive on all edges).References