s2geometry
s2geometry copied to clipboard
python binding: S2RegionCoverer GetCovering/GetInteriorCovering returns list instead of S2CellUnion
Hey.
According to http://s2geometry.io/devguide/s2cell_hierarchy GetCovering/GetInteriorCovering should return S2CellUnions... in Python however they return a tuple (of S2CelIIds).
Is this intended?
Cheers, Chris.
Can you show your code? Are you sure it's a tuple? I think it probably can just be assigned to a tuple because it's iterable, like (x, y) = [1, 2].
I printed the type in the unit test and it's a list. We're wrapping the version that returns a vector<S2CellId>, not a S2CellUnion
https://github.com/google/s2geometry/blob/master/src/s2/s2region_coverer.h#L189 https://github.com/google/s2geometry/blob/master/src/python/s2_common.i#L501
Ah, I see... well in principle that's okay for me... my code already works using that version ^^
So from my side you can also just close that issue.... unless you say you rather want to keep the function signature more similar, i.e. return the S2CellUnion... and for the other version, use a signature more similar to the C version like GetCovering(list, returnlist)