Closed iskandari closed 4 months ago
Is this the python API? The C++ has S2Polygon::InitToCellUnionBorder: https://github.com/google/s2geometry/blob/master/src/s2/s2polygon.h#L594
On Wed, May 1, 2024 at 10:25 PM Alexander Tedeschi @.***> wrote:
Given a union of s2 cells that originate from GetCovering(), is it possible using the s2 API (in python or go) to obtain the exterior geometry of this union ?
s2_cells = coverer.GetCovering(s2_polygon)print(s2_cells[0:5])
(<s2geometry.S2CellId; proxy of <Swig Object of type 'S2CellId ' at 0x12fcf3120> >, <s2geometry.S2CellId; proxy of <Swig Object of type 'S2CellId ' at 0x12fcf2e80> >, <s2geometry.S2CellId; proxy of <Swig Object of type 'S2CellId ' at 0x12fcf3690> >, <s2geometry.S2CellId; proxy of <Swig Object of type 'S2CellId ' at 0x12fcf3d80> >, <s2geometry.S2CellId; proxy of <Swig Object of type 'S2CellId *' at 0x12fcf2940> >) cell_union.Init([cell.id() for cell in s2_cells])
unsure where to go from here
I have tried with a buffering operation but it seems only to return True/False
opts = s2.S2BufferOperationOptions()opts.set_buffer_radius(s2.S1Angle.Degrees(0.001))result = s2.S2Polygon()layer = s2.S2PolygonLayer(result)op = s2.S2BufferOperation(layer, opts)for cell in s2_cells: op.AddPolygon(s2.S2Polygon(s2.S2Cell(cell)))
I love using s2 and would be grateful for any suggestions!
— Reply to this email directly, view it on GitHub https://github.com/google/s2geometry/issues/363, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEMKX5V7NY63PWC7EZM3DZAG523AVCNFSM6AAAAABHC7LPSSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TINJWGYYTCNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Looking for a pythonic solution but will try the C++ method!
Given a union of s2 cells that originate from
GetCovering()
, is it possible using the s2 API (in python or go) to obtain the exterior geometry or loop of this union (assuming the union forms a polygon) ?I have tried with a buffering operation but it seems only to return True/False
I love using s2 and would be grateful for any suggestions on how to obtain the exterior of a covering!