Interaction with Geo types
- Dominant language
- Rust
- Stars
- 108
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
From @bluenote10's [comment](https://github.com/georust/geo/issues/380#issuecomment-573314264):
>I'm wondering if there is a good way to avoid the type conversion. Currently the robust crate interface relies on its own robust::Coord type. As far as I can see, computing orient2d on a geo::Coordinate requires to first duplicate the data into a robust::Coord, which seems unnecessary and a bit tedious. What is the best solution to that in Rust? Would it make sense to change the interface to orient2d(pa_x: f64, pa_y: f64, pb_x: f64, pb_y: f64, pc_x: f64, pc_y: f64)?
Several possibilities here:
- Switch to `geo_types::Coordinate` (I assume @frewsxcv didn't use it for a reason, but it may simply have been in order to get everything working)
- Write `From` impls for `Geo` types (and primitive types such as `(T, T)` and `[T; 2]`) to `robust::Coord`, and modify the functions to accept `Into` instead, with an explicit `into()` call inside the functions.
Either way, we'll probably want to land #3 first.
Contributor guide
No contributing guide indexed for this repository
Research direction
Review issue #3 and the current robust crate interface first. Compare the proposed geo_types::Coordinate and From/Into approaches, then establish which Geo types and conversions the API should support; done means an agreed approach for orient2d and related predicates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100