Example #1
0
import ogr

if __name__ == '__main__':
    ### GIS Data
    slope_raster = 'testdata//slope.tif'
    elevation_raster = 'testdata//dem.tif'

    property_shp = ogr.Open('testdata//test_stand.shp')
    property_lyr = property_shp.GetLayer()
    stand_lyr = property_shp.GetLayer()
    feat = stand_lyr.GetFeature(0)
    geom = feat.GetGeometryRef()
    stand_wkt = geom.ExportToWkt()

    area = gis.area(stand_lyr)
    elevation = gis.zonal_stats(elevation_raster, stand_lyr)
    slope = gis.zonal_stats(slope_raster, stand_lyr)

    ### Tree Data ###
    # Harvest Type (clear cut = 0, partial cut = 1)
    PartialCut = 0

    # Hardwood Fraction
    HdwdFractionCT = 0.15
    HdwdFractionSLT = 0.0
    HdwdFractionLLT = 0.0

    # Chip Trees
    RemovalsCT = 200.0
    TreeVolCT = 5.0
Example #2
0
    # Road Landing Coordinates
    coords_landing_road = landing.road(newRoadsfn, standfn)

    # Routing
    haulDist, haulTime, coord_mill = r.routing(coords_landing_road, mill_coords=None, mill_shp=mill_shp)

    stand_shp = ogr.Open(standfn)
    stand_lyr = stand_shp.GetLayer()
    standCount = stand_lyr.GetFeatureCount()
    for stand in stand_lyr:

        stand_geom = stand.GetGeometryRef()
        stand_wkt = stand_geom.ExportToWkt()

        area = gis.area(stand_wkt)
        elevation = gis.zonal_stats(elevation_raster, standfn, stand_wkt)
        slope = gis.zonal_stats(slope_raster, standfn, stand_wkt)

        coords_landing_stand = landing.stand(stand_wkt, newRoadsfn)

        ### Tree Data ###
        # Harvest Type (clear cut = 0, partial cut = 1)
        PartialCut = 0
        # Hardwood Fraction
        HdwdFractionCT = 0.15
        HdwdFractionSLT = 0.0
        HdwdFractionLLT = 0.0
        # Chip Trees
        RemovalsCT = 200.0
        TreeVolCT = 5.0
        # Small Log Trees
Example #3
0
import ogr

if __name__ == '__main__':
    ### GIS Data
    slope_raster = 'testdata//slope.tif'
    elevation_raster = 'testdata//dem.tif'

    property_shp = ogr.Open('testdata//test_stand.shp')
    property_lyr = property_shp.GetLayer()
    stand_lyr = property_shp.GetLayer()
    feat = stand_lyr.GetFeature(0)
    geom = feat.GetGeometryRef()
    stand_wkt = geom.ExportToWkt()

    area = gis.area(stand_lyr)
    elevation = gis.zonal_stats(elevation_raster, stand_lyr)
    slope = gis.zonal_stats(slope_raster, stand_lyr)

    ### Tree Data ###
    # Harvest Type (clear cut = 0, partial cut = 1)
    PartialCut = 0

    # Hardwood Fraction
    HdwdFractionCT = 0.15
    HdwdFractionSLT = 0.0
    HdwdFractionLLT = 0.0

    # Chip Trees
    RemovalsCT = 200.0
    TreeVolCT = 5.0