Esempio n. 1
0
def ras1dSACElevations(rgis):
    """Probe a DTM to find storage areas connections 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.SACSurface()
    parent_obj = heco.SAConnections()
    update_DtmID(rgis, parent_obj)
    try:
        chunk = rgis.dtm_chunksize
    except:
        chunk = 0

    # insert points along each sa connection
    rgis.rdb.process_hecobject(heco.SACSurface, 'pg_create_table')
    rgis.rdb.process_hecobject(heco.SAConnections, '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()
Esempio n. 2
0
def ras1dSACElevations(rgis):
    """Probe a DTM to find storage areas connections 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.SACSurface()
    parent_obj = heco.SAConnections()
    update_DtmID(rgis, parent_obj)
    try:
        chunk = rgis.dtm_chunksize
    except:
        chunk = 0

    # insert points along each sa connection
    rgis.rdb.process_hecobject(heco.SACSurface, 'pg_create_table')
    rgis.rdb.process_hecobject(heco.SAConnections, '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()
Esempio n. 3
0
def ras1dSAElevations(rgis):
    """Probe a DTM to later find storage area volume"""
    # Prepare DTMs
    prepare_DTMs(rgis)
    if not rgis.dtms:
        rgis.addInfo('<br>No DTM for elevation sampling. Probing aborted!')
        return False
    surface_obj = heco.SASurface()
    parent_obj = heco.StorageAreas()
    update_DtmID(rgis, parent_obj)
    try:
        chunk = rgis.dtm_chunksize
    except:
        chunk = 0

    # probe a DTM at each point
    QApplication.setOverrideCursor(Qt.WaitCursor)
    try:
        rgis.addInfo('<br><b>Calculating Storage Areas elevation values...</b>')
        rgis.rdb.process_hecobject(heco.SASurface, 'pg_create_table')
        rgis.addInfo('Creating point grid inside Storage Areas...')
        rgis.rdb.process_hecobject(heco.StorageAreas, 'pg_surface_points')
        rgis.addInfo('Extracting values from raster...')
        probe_DTMs(rgis, surface_obj, parent_obj, chunksize=chunk)
        rgis.addInfo('Updating maximum and minimum elevation values in Storage Areas...')
        rgis.rdb.process_hecobject(heco.StorageAreas, 'pg_maxmin')
        rgis.addInfo('Done')
    finally:
        QApplication.restoreOverrideCursor()
    return True
Esempio n. 4
0
def ras1dSAElevations(rgis):
    """Probe a DTM to later find storage area volume"""
    # Prepare DTMs
    prepare_DTMs(rgis)
    if not rgis.dtms:
        rgis.addInfo('<br>No DTM for elevation sampling. Probing aborted!')
        return False
    surface_obj = heco.SASurface()
    parent_obj = heco.StorageAreas()
    update_DtmID(rgis, parent_obj)
    try:
        chunk = rgis.dtm_chunksize
    except:
        chunk = 0

    # probe a DTM at each point
    QApplication.setOverrideCursor(Qt.WaitCursor)
    try:
        rgis.addInfo(
            '<br><b>Calculating Storage Areas elevation values...</b>')
        rgis.rdb.process_hecobject(heco.SASurface, 'pg_create_table')
        rgis.addInfo('Creating point grid inside Storage Areas...')
        rgis.rdb.process_hecobject(heco.StorageAreas, 'pg_surface_points')
        rgis.addInfo('Extracting values from raster...')
        probe_DTMs(rgis, surface_obj, parent_obj, chunksize=chunk)
        rgis.addInfo(
            'Updating maximum and minimum elevation values in Storage Areas...'
        )
        rgis.rdb.process_hecobject(heco.StorageAreas, 'pg_maxmin')
        rgis.addInfo('Done')
    finally:
        QApplication.restoreOverrideCursor()
    return True