#------------------------------------------------------------------------------- # Name: VolumeCalculator.py # Purpose: Calculate a volume under an arbitary rectangle # # Author: kimo # # Created: 05/06/2014 # Copyright: (c) kimo 2014 # Licence: Creative Commons 3.0 NZ #------------------------------------------------------------------------------- import arcpy import math fds = arcpy.GetParameter(0) width = arcpy.GetParameter(1) length = arcpy.GetParameter(2) angle = arcpy.GetParameter(3) raster = arcpy.GetParameter(4) tin = arcpy.GetParameter(5) # the fds is an in_memory featureclass, get the first point with arcpy.da.SearchCursor(fds,["SHAPE@X","SHAPE@Y"]) as cur: row = cur.next() x = row[0] y = row[1] # feedback for demo msg = "{} {} {} {} {} {} {}".format(x,y,width,length,angle,raster,tin) arcpy.AddMessage(msg) # calculate volume....
Kimo where is the script for the tool? It wasn't embedded.
Cheers
How do I insert a zip file? It seems that Geonet is just a facebook gossip app. I could only insert images. Instead here is a link to my own website. I don't think the questioner really wanted to use python, they were just confirming that someone else would have to be commissioned to do the work! http://www.ollivier.co.nz/download/voltoolbox.zip
> Basically the same idea where the user will click on the map, a box appears to enter length, width, and angle, and it will calculate the volume by pixel of the raster.
You can do this in ModelBuilder with a feature set, and some creative work with the Calculate Value tool to set up an extent for the Raster Calculator tool.