Résumé
Categorizes the pixel values of a raster object into groups based on zones defined in another raster and zone-dependent value mapping defined in a table.
Discussion
For more information about how this function works, see the Zonal Remap raster function.
The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.
Syntaxe
ZonalRemap (raster, zonal_attribute_table, {zone_raster}, {zone_field}, {min_value_field_name}, {max_value_field_name}, {output_value_field_name}, {background_value}, {default_output_value}, {where_clause})
Paramètre | Explication | Type de données |
raster | A single-band raster input containing pixel values to remap. | Raster |
zonal_attribute_table | A table containing at least three fields. The table must have a minimum threshold value, a maximum threshold value, and a target value. The target value is the name of the field that will contain the remapped value. The format of the input can be a feature class, feature service, or any table type that ArcGIS supports. | String |
zone_raster | A single-band raster, where each pixel defines zones associated with a particular location. A zone is defined as all areas in the input that have the same value. The areas do not have to be contiguous. (La valeur par défaut est None) | RasterCollection |
zone_field | The field name in the zonal_attribute_table that contains the zone ID values. The zone ID values are directly tied to the zone IDs in your zonal raster. The zone ID values provide another level of filtering while remapping. If there is no zone ID associated with a particular record in the table, it will not participate in the remapping. (La valeur par défaut est 'ZoneID') | String |
min_value_field_name | The field name containing the minimum value above which an input pixel is remapped. If left unspecified, or if the field value is null, pixel values are not tested for minimum. (La valeur par défaut est 'ZoneMin') | String |
max_value_field_name | The field name containing the maximum value below which an input pixel is remapped. If left unspecified, or if the field value is null, pixel values are not tested for maximum. (La valeur par défaut est 'ZoneMax') | String |
output_value_field_name | The field name containing the target value to which an input pixel is remapped. If left unspecified, or if the field value is null, remapped pixel values are set to default_output_value. (La valeur par défaut est 'ZoneValue') | String |
background_value | The initial pixel value of the output raster, before input pixels are remapped. (La valeur par défaut est 0) | String |
default_output_value | The value that will be assigned to a pixel that does not satisfy any of the conditions set in the zonal_attribute_table. This value will also be the value of the output pixel if either the output_value_field_name parameter is left unspecified or the output value of the corresponding zonal threshold is left unspecified in the zonal_attribute_table. (La valeur par défaut est 255) | String |
where_clause | A query applied to the zonal_attribute_table. (La valeur par défaut est None) | String |
Type de données | Explication |
Raster | The remapped raster object. |
Exemple de code
Remap pixels in a raster according to zones defined in another raster, or zone-dependent values defined in a table.
from arcpy.sa import *
out_zonalremap_raster = ZonalRemap("cloudceilings.tif","zonal.csv", "zone.tif")
out_zonalremap_raster.save("C:/arcpyExamples/outputs/Zonal_remap.tif")
Remap pixels in a raster according to zones defined in another raster, or zone-dependent values defined in a table.
# Import system modules
import arcpy
from arcpy.sa import *
# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"
# Set the local variables
in_raster = "NDVI.tif"
zonal_attribute_table = "zonal.csv"
zone_raster = "neighborhoods.tif"
# Apply ZonalRemap function
zonal_remap_raster = ZonalRemap(in_raster, zonal_attribute_table, zone_raster)
# Save the output
zonal_remap_raster.save("C:/arcpyExamples/outputs/NDVI.tif")
Rubriques connexes
Vous avez un commentaire à formuler concernant cette rubrique ?