Leveepoints' Elevation...

0 votes
296 views
asked Feb 12, 2017 by Sandra (120 points)
Hello everyone,

Why launching Levees command, Leveepoints Elevation field isn't completed?

Is or not implemented this function?

Thanks to anyone could answer

P.S.

Congrats for the wonderful plugin.
commented Feb 12, 2017 by Sandra (120 points)
Hello everyone,

I tried to make the RAS1D Levees command update the levee points' elevation, at the same level of the DTM, but unsuccesfully.

I post the hecobjects.py part I modified, it is only this class.


class LeveeAlignment(HecRasObject):
    def __init__(self):
        super(LeveeAlignment, self).__init__()
        self.order = 10
        self.geom_type = 'LINESTRING'
        self.attrs = [('"LeveeID"', 'serial primary key'),('"DtmID"', 'integer')]

    def pg_levee_positions(self):
        qry = '''
        INSERT INTO "{0}"."LeveePoints"(geom, "LeveeID", "XsecID", "Fraction")
        SELECT
            ST_Intersection(lev.geom, xs.geom) AS geom,
            lev."LeveeID",
            xs."XsecID",
            ST_LineLocatePoint(xs.geom, ST_Intersection(lev.geom, xs.geom)) AS "Fraction"
        FROM
            "{0}"."LeveeAlignment" AS lev,
            "{0}"."XSCutLines" AS xs
        WHERE
            ST_Intersects(xs.geom, lev.geom);
        '''
            qry = qry.format(self.schema)
            #return qry



        """Probe a DTM to find cross-section vertical shape"""
        # Prepare DTMs
        prepare_DTMs(rgis)
        if not rgis.dtms:
            rgis.addInfo('<br>No DTM for elevation sampling. Probing aborted!')
            return
        #surface_obj = heco.LeveePoints()
        #parent_obj = heco.LeveeAlignment()
        surface_obj = LeveePoints()
        parent_obj = LeveeAlignment()
        update_DtmID(rgis, parent_obj)
        try:
            chunk = rgis.dtm_chunksize
        except:
            chunk = 0

        # insert points along each xsection
        #rgis.rdb.process_hecobject(heco.LeveePoints, 'pg_create_table')
        #rgis.rdb.process_hecobject(heco.XSCutLines, 'pg_surface_points')

        # probe a DTM at each point
        QApplication.setOverrideCursor(Qt.WaitCursor)
        try:
            probe_DTMs(rgis, surface_obj, parent_obj, chunksize=chunk)
            rgis.addInfo('Done')
        finally:
            QApplication.restoreOverrideCursor()

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
Welcome to RiverGIS Q&A, where you can ask questions and receive answers from other members of the community.

Visit rivergis.com for documentation and general info about the QGIS plugin.
...