Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

Related to answer I gave to a similar question (determine min and max elevation ... within my current extentdetermine min and max elevation ... within my current extent), I wonder if this would work:

import arcpy

# this sets extent to current display, you can instead set it to ROI polygon
arcpy.env.extent = arcpy.mapping.MapDocument.activeView.Extent

# for a multi-band raster, pay attention to the band index (last input)
arcpy.MakeRasterLayer_management("c:/temp/raster.tif", "rlayer", "#", arcpy.env.extent, "1")

# Get the geoprocessing result object
bandMinResult = arcpy.GetRasterProperties_management("rlayer", "MINIMUM")
# Get the elevation minimum value from geoprocessing result object
bandMinDN = elevMinResult.getOutput(0)

Related to answer I gave to a similar question (determine min and max elevation ... within my current extent), I wonder if this would work:

import arcpy

# this sets extent to current display, you can instead set it to ROI polygon
arcpy.env.extent = arcpy.mapping.MapDocument.activeView.Extent

# for a multi-band raster, pay attention to the band index (last input)
arcpy.MakeRasterLayer_management("c:/temp/raster.tif", "rlayer", "#", arcpy.env.extent, "1")

# Get the geoprocessing result object
bandMinResult = arcpy.GetRasterProperties_management("rlayer", "MINIMUM")
# Get the elevation minimum value from geoprocessing result object
bandMinDN = elevMinResult.getOutput(0)

Related to answer I gave to a similar question (determine min and max elevation ... within my current extent), I wonder if this would work:

import arcpy

# this sets extent to current display, you can instead set it to ROI polygon
arcpy.env.extent = arcpy.mapping.MapDocument.activeView.Extent

# for a multi-band raster, pay attention to the band index (last input)
arcpy.MakeRasterLayer_management("c:/temp/raster.tif", "rlayer", "#", arcpy.env.extent, "1")

# Get the geoprocessing result object
bandMinResult = arcpy.GetRasterProperties_management("rlayer", "MINIMUM")
# Get the elevation minimum value from geoprocessing result object
bandMinDN = elevMinResult.getOutput(0)
Source Link
Erica
  • 9k
  • 4
  • 34
  • 80

Related to answer I gave to a similar question (determine min and max elevation ... within my current extent), I wonder if this would work:

import arcpy

# this sets extent to current display, you can instead set it to ROI polygon
arcpy.env.extent = arcpy.mapping.MapDocument.activeView.Extent

# for a multi-band raster, pay attention to the band index (last input)
arcpy.MakeRasterLayer_management("c:/temp/raster.tif", "rlayer", "#", arcpy.env.extent, "1")

# Get the geoprocessing result object
bandMinResult = arcpy.GetRasterProperties_management("rlayer", "MINIMUM")
# Get the elevation minimum value from geoprocessing result object
bandMinDN = elevMinResult.getOutput(0)