I have a table with multiple min and a max numbers for multiple points. I would like to use "Extract by Attribute" to pull the fitting areas from a DEM which corresponds to each area.
rows = arcpy.SearchCursor("areatable.dbf") k = 1 for row in rows: a1min = float(row.getValue("Area1Min")) a1max = float(row.getValue("Area1Max")) where = "VALUE > {0} AND VALUE < {1}".format(a1min, a1max) dem1 = ExtractByAttributes(Raster("dem"), where) dem1.save("dema{}".format(k)) # save as grids dema1, dema2 del row, rows
dem = Raster("dem1") dem1 = Con(dem > a1min and dem < a1max, dem)
The tool turns out a raster with no "values". While they can be displayed, they are incredibly large files and can not be converted to a shape file due to not having any data attached.
dem1 = SetNull(IsNull(ExtractByAttributes(Raster("dem"), where)),1)
The Extract by attribute tool however created more questions than it answered.
where = "VALUE > " + str(a1min) + " AND VALUE < " + str(a1max) where = "VALUE > {0} AND VALUE < {1}".format(a1min, a1max)
VALUE > 5000 AND VALUE < 6000
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.