1

I want to calculate "surface area in a basin with reference to incremental height of DAM"

i tried this:

step_size = 10 # metres; reduce this if you want finer resolution
num_steps = 20 # increase this, if you need more steps
workspace = r'C:\Some\path\to\folder'
raster_file = 'mytopo.tif'

gp = arcgisscripting.create()
gp.CheckOutExtension ('3D')
gp.workspace = workspace

# Start from the minimum elevation
min_rast = gp.GetRasterProperties(raster_file, 'MINIMUM')

# Start CSV output of elevation/volume relationship
print('step, height, elev, volume')
for step in range(num_steps):
    height = float(step*step_size)
    elev = min_rast + height
    gp.SurfaceVolume_3d(raster_file, '', 'BELOW', elev)
    result = gp.GetMessages()
    volume = float(re.findall(r'Volume= *([\d\.]+)', result)[0])
    print(', '.join([repr(x) for x in [step + 1, height, elev, volume]]))

Can you help me edit this code to get volume to get surface area?

closed as unclear what you're asking by PolyGeo Nov 18 '16 at 4:13

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Welcome to GIS SE! Can you please edit your question and be more specific what you have done so far and about the nature of your datasets. The question is very broad and it is unlikely that we are able to help you. – Kersten Jul 14 '15 at 10:41
  • What happens when you run the code snippet that you have presented? – PolyGeo Nov 18 '16 at 4:13