Python API level: snail_intersections.split can now handle geodataframes that contains both linestrings and polygons.
Python/C++ interface: intersections.split_polygon takes an oriented shapely Polygon object and raster metadata and returns a list of split Polygons
C++ level: splitAlongGridlines Splits inner segments between 2 crosings on exterior ring, returns a vector of splits (linestr).
Todo:
[x] Get rid of feature class (used in C++ splitAlongGridlines, intersections.splitPolygon)
[x] Rename files find_intersections_linestring.[cpp,hpp] which now also describe splitting inner gridlines inside polygon (or move function to other file)
[x] Unit test(s) for C++ function splitAlongGridlines
[x] Unit test for split_polygon wrapper at the C++/Python interface level (in intersections.cpp module). Maybe unnecessary since we essentially test this as the Python API level
[x] #31
To start off with, the current set of changes could use some refactoring/commenting. This is mainly a translation of the Python prototype (see #25 ), but the C++ code is certainly less expressive.
snail_intersections.split
can now handle geodataframes that contains both linestrings and polygons.intersections.split_polygon
takes an oriented shapelyPolygon
object and raster metadata and returns a list of splitPolygon
ssplitAlongGridlines
Splits inner segments between 2 crosings on exterior ring, returns a vector of splits (linestr
).Todo:
splitAlongGridlines
,intersections.splitPolygon
)find_intersections_linestring.[cpp,hpp]
which now also describe splitting inner gridlines inside polygon (or move function to other file)splitAlongGridlines
Unit test forsplit_polygon wrapper
at the C++/Python interface level (inintersections.cpp module
). Maybe unnecessary since we essentially test this as the Python API levelTo start off with, the current set of changes could use some refactoring/commenting. This is mainly a translation of the Python prototype (see #25 ), but the C++ code is certainly less expressive.