-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Transform
algorithm for transforming a geometry with PROJ.
#718
Conversation
f02bb07
to
48048ea
Compare
This is nice to have, but I'm wondering if it's better to take the transform instead of the two CRSes. I don't know how long these take to instantiate in practice, but it seems like you'd want to reuse them when possible. |
I agree, even though the trade-off is a less-nice API. However, without something that takes a
|
What if the argument was |
I like it. |
It's okay, but not really discoverable. |
I agree the |
To recap, I agree that accepting a And ("EPSG:4326", "EPSG:3857").try_into() is concise, but I don't think that I'd guess for it to exist. The docs you're planning to add will help. But I usually go to the docs only after I fail to intuit the API. If we think that often people will want to use the initially proposed interface (from: &str, to: &str), then I think it makes sense to expose a more discoverable helper method, like this:
WDYT? If it's controversial, don't worry about it. We could always add it later. |
I tried this out and it works great! Question: Does it make sense to use |
Great point @phayes! I think it's possible with the current API's we have (poly.interiors_mut(), line_string.0)... and if it's not possible we should consider making it so. It's a perf improvement that doesn't seem like it would impact the API proposed here, so I'd also be fine with leaving that for a followup PR depending on how much time @frewsxcv wants to sink into this right now. |
I don't have much time to push this over the finish line over the next few days. If anyone wants to take over and push to my branch, I'd say go for it. I'm also not opposed to merging as-is (ish) and following up with some of these changes. |
Thinking about the best performance here again, and I think the long-term solution is actually to add a Anyways, long-term idea that doesn't affect the API surface here. |
This is semi-blocked on georust/proj#100 and a |
What do folks think of doing something like this? |
36664c6
to
83a4664
Compare
Transform
algorithm for transforming a geometry's CRS.Transform
algorithm for transforming a geometry with PROJ.
83a4664
to
fbcd405
Compare
Once georust/proj#103 is reviewed, I will merge it and do a |
7ccecce
to
efce819
Compare
efce819
to
c990bc1
Compare
This is ready for review! |
bors r=lnicola |
Build succeeded: |
109: Port transform trait from geo and add a mutable flavor r=frewsxcv a=michaelkirk Fixes #101, #108 An alternative to #106, but as proposed in #108, I've done so by porting the [Transform trait from geo](georust/geo#718 ) to proj so that we won't need similar-but-different code in two places. I chose to double down on a trait-based approach since it seemed idiomatic to our other georust code. However, like proposed in #106, I leveraged proj_array in more places. /cc `@x4d3` corresponding PRs: - georust/geo#730 - frewsxcv/rgis#47 Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
CHANGES.md
if knowledge of this change could be valuable to users.lib.rs