Git Product home page Git Product logo

Comments (4)

philippkraft avatar philippkraft commented on June 1, 2024

Add a field string cmf::upslope::Cell::WKB in cell.h that can be loaded with a OGC-WKB representation. That WKB can be used to create Shapely-Polygons on the fly.

Creating cells and connecting cells can become two distinct jobs and cells_from_polygons would be simpler.

Challenge

How 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());
}

from cmf.

philippkraft avatar philippkraft commented on June 1, 2024

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

from cmf.

philippkraft avatar philippkraft commented on June 1, 2024

Use case for current API in here

from cmf.

ocni-dtu avatar ocni-dtu commented on June 1, 2024

I have not encountered any issues with the new make_cell_from_polygons.

I would appreciate if you pushed the work to PyPI.

from cmf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.