-
Notifications
You must be signed in to change notification settings - Fork 364
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 sparse stitch method to StitchCollectionMethods #3017
Add sparse stitch method to StitchCollectionMethods #3017
Conversation
f804627
to
f913799
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM actually! Only tests are required.
Also an extra question, mb it makes sense to add this method into SpatialTileLayoutRDDStitchMethods
as well?
Hmm. I'm torn. I think to add that method in that class I'd have to duplicate most of the logic and then replace the self.stitch with self.collect.stitch. Given that, it seems easier, if you have a
Done. Added a few simple ones to |
@CloudNiner but we already have this duplication It is our API problem - that for the current collections API we have to duplicate everything. If you'll look more close - Collection API completely duplicates the RDD API ¯_(ツ)_/¯ I dunno what is better at the moment - to keep consistency or to add ambiguity by adding such a divergence into the API. |
Ah, if we're going for 100% feature parity between RDD and Collections API, then I guess I have to add it. Bummer. |
Yea, I don't disagree with your point about duplication ): but it looks like at least for now it is better to add to keep everything consistent |
@pomadchin updated to include duplicate methods for RDDs |
f3d753b
to
19ab580
Compare
spark/src/main/scala/geotrellis/spark/stitch/StitchRDDMethods.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the use of ++
instead of :::
, but otherwise LGTM
19ab580
to
a4fae4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I already feel too pedantic :/
layer/src/main/scala/geotrellis/layer/stitch/StitchCollectionMethods.scala
Outdated
Show resolved
Hide resolved
Pulled in from geotrellis/geotrellis-contrib. The method uses a different algorithm, and therefore it feels more correct to name it differently from the original `stitch(): Raster[V]`. Also added a helper so that users who want to use the collection extent don't have to know how to get it, since this is the most likely default use case.
Code duplication not ideal here, but we aim for 100% parity in the APIs, so we can't avoid it without larger changes. Signed-off-by: CloudNiner <[email protected]>
a4fae4e
to
370b321
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging after the travis green light!
Overview
Adds sparseStitch methods to
SpatialTileLayoutCollectionStitchMethods
. The method uses a different algorithm, and therefore it felt more correct to name it differently from the originalstitch(): Raster[V]
. Also added a helper so that users who want to use the collection extent don't have to know how to get it, since this is the most likely default use case.Opened PR to get tests to run, since there's a breaking change on the type bounds of V. Initial testing in a few key places didn't raise any issues but I want the whole test suite to run. Edit: Full test suite passed, but upon further inspection it looks like we might not test stitch anywhere else.
Checklist
docs/CHANGELOG.rst
updated, if necessarydocs
guides update, if necessaryNotes
I want to add a unit test or two because there's nothing at all for any of these stitch functions, but that looks like its a bit of an effort since there's no easy test data constructor for the type we need to test. So submitting this for review now and moving on to a different task. I can attempt to add a test or two once we've settled on approval for the API presented here.
Closes #2903