-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rewrite geometry support #8
Comments
Add a field Creating cells and connecting cells can become two distinct jobs and cells_from_polygons would be simpler. ChallengeHow to mark a std::string as a Python byte-string? swig/swig#752 Idea: typedef bytestring std::string;
%typemap(out) bytestring {
$result = PyBytes_FromString($1.c_str());
} |
Added a get_WKB/set_WKB pair to cmf::upslope::Cell using the new type cmf::bytestring, a typedef of std::string. time.i sets swig typemaps to translate bytestring to PyBytes. If shapely is present __init__.py adds dynamically a geometry property to the cmf.Cell class.
Current usage for cell geometry now (if shapely is present): c.geometry = feature.shape Needed: A cell creator helper function, like: def make_cell_from_polygon(project, polygon, z, id=None, with_surfacewater=True):
c=p.NewCell(polygon.centroid.x, polygon.centroid.y, polygon.centroid.z,
polygon.area, with_surfaceswater)
c.geometry = polygon
if id is not None:
c.Id = id
return c |
Use case for current API in here |
I have not encountered any issues with the new make_cell_from_polygons. I would appreciate if you pushed the work to PyPI. |
Follow up to #7.
With using the
__geo_interface__
, the cells_from_polygons function will get a complete rewrite with API change. The callables are hard to explain and ugly to use.The text was updated successfully, but these errors were encountered: