Tool Population In Floodplain Metrics - USEPA/ATtILA2 GitHub Wiki

Population in Floodplain Metrics

Summary

Calculates percentage of total population living in floodplain areas for each reporting unit polygon and creates an output table.

Counts for the total population in the reporting unit and within the floodplain area are also reported.

Usage

  • This tool processes all polygons in the Reporting unit feature regardless of selections set. The ability to limit calculations to only selected reporting unit polygons is not supported in this release.

  • NOTE: For the most accurate results and shortest processing times, it is highly recommended that all input layers be in the same spatial reference.

  • NOTE: Enabling the Parallel Processing Factor environment can improve computation time for several ATtILA tools, but we have detected, on rare occasions, doing so can lead to spurious results. As a precaution, ATtILA will disable the Parallel Processing Factor environment for this tool. We hope to return this choice to the user once the impact on operational speed and accuracy of swapping geoprocessing tools with their pairwise counterparts has been assessed.

  • The Reporting unit feature is a zone dataset.

    • A zone is defined as all areas in the input that have the same value. The areas do not have to be contiguous. The term "value" in this definition refers to the unique values in the Reporting unit ID field. Therefore, all polygons with the same reporting unit ID are treated as a single zone.

    • When more than one polygon has the same reporting unit ID, the areas for each polygon are combined and metrics are reported as a single record in the Output table.

  • As the Reporting unit feature is a vector dataset, ArcGIS will perform a vector to raster conversion during processing.

    • To better control the vector to raster conversion, the tool defaults the Snap raster and the Processing cell size to that of the Land cover grid. These may be changed from within the tool.

    • If the extent of the Reporting unit feature is smaller than that of the Land cover grid, the user may wish to check the Reduce land cover grid to smallest recommended size option. This creates a temporary land cover raster with the processing extent equal to that of the Reporting unit feature to avoid unnecessary processing.

  • If the Reporting unit feature has overlapping features, the zonal analysis will be performed for each individual feature.

  • If a feature in the Reporting unit feature zone data does not overlap any cell centers in the secondary class rasters (e.g.,Land cover grid), those zones will not get converted to the internal zone raster. As a result, those zones will not be represented in the Output table.

  • The Population raster or polygon feature will allow you to choose either a raster, or a polygon feature.

    • When choosing a raster, this tool assumes the grid cell value to be the population count for the grid cell.

    • When choosing a polygon feature, this tool assumes that population is distributed evenly throughout each feature polygon. The tool apportions population by area weighting. For example, if 50% of a population polygon is within a reporting unit, the tool will assign 50% of the value in the polygon's Population field to that reporting unit. Caution should be exercised when population polygons do not have even population distributions as this could result in an overweighting or underweighting of population when the tool performs the apportionment. Generally, greater accuracy will be achieved if the population polygons are smaller than the smallest Reporting unit feature polygons.

    • NOTE: The Population field dropdown is only available when the Population raster or polygon feature is a polygon feature.

    • NOTE: The Population field will default to 'Value' when the Population raster or polygon feature is an integer grid.

    • NOTE: The Population field will be empty when the Population raster or polygon feature is a non-integer grid.

  • The Floodplain raster or polygon feature will allow you to choose either a raster, or a polygon feature.

    • When choosing a raster, floodplains are defined as any non-zero grid cell. The simplest example of this is a binary raster where floodplains are coded as 1 and everything else is coded as 0, but any value or comination of values can be used to designate floodplain areas as long as non-floodplain areas are coded as 0.

    • When choosing a polygon feature, floodplains are defined as any polygon feature. This tool does not make use of any attribute or combination of attributes to select floodplain polygons. All polygons in the floodplain input layer are considered floodplain areas. If polygons exits within the layer that do not represent floodplains, they need to be edited out before using the layer as input for this tool.

  • Final output is written to the location specified in the Output table parameter. The Output table may be saved as a File Geodatabase Table, or a dBASE Table.

    • NOTE: For most consistent results, it is highly recommended that tool output be saved to a file geodatabase.

    • When saving as a File Geodatabase Table, no extension is necessary for the Output table name. The output location must be a file geodatabase.

    • When saving as a dBASE Table, include the .dbf extension in the Output table name. dBASE tables may not be saved in a file geodatabase.

  • Field names in the Output table are as follows:

    • RU_POP - The population for the reporting unit.

    • FP_POP_C - The population in a floodplain for the reporting unit.

    • FP_POP_P - The percentage of the reporting unit population in a floodplain.

  • In Additional Options, the user may elect to 'Retain Intermediate Layers Generated During Metric Processing'.

    • Retain Intermediate Layers Generated During Metric Calculation

      • Choosing INTERMEDIATES retains several of the key intermediate products (e.g., rasters, feature classes, tables) used to generate the final tool output. By examining the intermediate products, the user can gain a better understanding how the metric is calculated. The following intermediate products are listed in the general order they are generated:

        • pifm_[Population polygon feature]_Work# (vector) - A copy of the Population polygon feature with the Population field retained and a tmpClass field added to assist in the population calculations via a Tabulate Intersection operation. This feature class is only produced when a polygon population feature is selected.

        • pifm_populationCnt_RU# (table) - A table of the population count within each reporting unit.

          • if the Populaton raster or polygon features is a raster, this table is produced using a Zonal Statistics as Table operation with the Reporting unit feature as the in_zone_data, the Reporting unit ID field as the zone_field, the Population raster as the in_value_raster, and 'Sum' as the statistics_type.

          • if the Populaton raster or polygon features is a polygon feature, this table is produced using a Tabulate Intersection operation using Reporting unit feature as the in_zone_features, Reporting unit ID field as the zone_field, pifm_[Population polygon feature]_Work# as the in_class_features, tmpClass as the class-fields, and Population field as the sum_fields.

        • pifm_populationFP (raster) - A raster produced by using SetNull to set non-floodplain areas (VALUE = 0) in the Floodplain raster to NoData and replacing the floodplain areas with values from the Population raster. This raster is only produced when both the inputs for Population raster or polygon feature and Floodplain raster or polygon feature are rasters.

        • pifm_[Floodplain raster feature]_Poly# (vector) - A polygon feature class produced by setting 0-value areas in the input floodplain raster to NULL and then performing a raster to polygon conversion. A tmpClass field is added to assist in the population calculations via a Tabulate Intersection operation This feature class is only produced when a raster floodplain feature is selected.

        • pifm_[Floodplain polygon feature]_Work# (vector) - A copy of the Floodplain polygon feature with a tmpClass field added to assist in the population calculations via a Tabulate Intersection operation. This feature class is only produced when both population and floodplain input features are polygons.

        • pifm_[Floodplain raster or polygon feature]_Identity# (vector) - A feature class of the floodplain areas by reporting unit. This feature class is produced when at least one input is a polygon feature.

          • if the Population input is a raster and the Floodplain input is a polygon feature: This feature class is a copy of the Floodplain polygon feature with the overlying Reporting unit feature's ID attached via Identity.

          • if the Population input is a polygon feature and the Floodplain input is a raster: This feature class is a copy of the intermediate pifm_[Floodplain raster feature]_Poly# with the overlying Reporting unit feature's ID attached via Identity.

          • if the Population input is a polygon feature and the Floodplain input is a polygon feature: This feature is a copy of the intermediate pifm_[Floodplain polygon feature]_Work# with the overlying Reporting unit feature's ID attached via Identity.

        • pifm_populationCnt_FP# (table) - A table of the population count in floodplain areas within each reporting unit. Depending on the inputs used for the Population and Floodplain parameters, the table is produced in one of four ways:

          1. Raster Population and Raster Floodplain: this table is produced using a Zonal Statistics as Table operation with the Reporting unit feature as the in_zone_data, the Reporting unit ID field as the zone_field, the intermediate pifm_populationFP as the in_value_raster, and 'Sum' as the statistics_type.

          2. Raster Population and Polygon Floodplain: this table is produced using a Zonal Statistics as Table operation with the intermediate pifm_[Floodplain polygon feature]_Identity# as the in_zone_data, the Reporting unit ID field as the zone_field, the Population raster as the in_value_raster, and 'Sum' as the statistics_type.

          3. Polygon Population and Raster Floodplain: this table is produced using a Tabulate Intersection operation using pifm_[Floodplain raster]_Identity# as the in_zone_features, Reporting unit ID field as the zone_field, pifm_[Population polygon feature]_Work# as the in_class_features, tmpClass as the class-fields, and Population field as the sum_fields.

          4. Polygon Population and Polygon Floodplain: this table is produced using a Tabulate Intersection operation using pifm_[Floodplain polygon feature]_Identity# as the in_zone_features, Reporting unit ID field as the zone_field, pifm_[Population polygon feature]_Work# as the in_class_features, tmpClass as the class-fields, and Population field as the sum_fields.

        • NOTE: To ensure unique filenames, intermediate filenames are typically generated using the CreateScratchName ArcPy function. This function provides a unique name for the intermediate product by appending a number to a filename prefix. The number starts at 0 and is incremented until a unique filename for the output workspace is found. The generated number is represented in this manual by the hashtag (#) symbol.

        • NOTE: The appended number may not be the same for all intermediate products saved during a tool run. Running a tool with different input options can result in different intermediate products being produced. If a tool is run more than once using the same output workspace, different number suffixes may be generated depending on the files already present in the output workspace.

      • Intermediate products are saved to one of the following locations:

        • When the Output table is saved as a File Geodatabase Table, intermediate products are placed in the same file geodatabase.

        • When the Output table is saved as a dBASE Table, a file geodatabase named "attilaScratchWorkspace" is automatically generated in the same output location specified for the Output table. Intermediate products are placed in the attilaScratchWorkspace file geodatabase.

        • NOTE: ATtILA will report the location of the saved intermediate products in the Tool Details' Messages section.

Syntax

PIFM (Reporting_unit_feature, Reporting_unit_ID_field, Population_raster_or_polygon_feature, {Population_field}, Floodplain_raster_or_polygon_feature, Output_table, {Select_options})

Parameter Explanation Data Type
Reporting_unit_feature The vector polygon dataset that defines the reporting units. Feature Layer
Reporting_unit_ID_field The field in the Reporting unit feature layer that contains the unique ID for each reporting unit.

It may be an integer or a string data type.
Field
Population_raster_or_polygon_feature The raster or vector polygon dataset that contains population data. Feature Layer or Raster Layer
Population_field (Optional) The field in the Population raster or polygon feature layer that contains population data.

The behavior of this parameter is dependent on the input for the Population or polygon feature:

  • The field selection dropdown is available when the input is a polygon feature.
  • The field selection will default to 'Value' when the input is an integer grid.
  • The field selection will be empty when the input is a non-integer grid.
Field
Floodplain_raster_or_polygon_feature The integer raster or vector polygon dataset that defines the floodplains.

  • Integer Raster - raster where non-zero values define floodplain areas. Values of 0 represent non-floodplains.
  • Polygon Feature - all polygon features are considered floodplain areas regardless of attributes.
Feature Layer or Raster Layer
Output_table The output reporting unit metrics table to be created.

It is recommended that the Output table be saved within a file geodatabase.
Table
Select_options (Optional) One tool option is available to provide additional information:

  • Retain Intermediate Layers Generated During Metric Calculation - Saves the intermediate data layers that are normally deleted after processing is complete.
Multiple Value

Code Samples

Population in Floodplain Metrics example 1 (Python window)

This example returns a table with the population count within the reporting unit, the population count in any floodplain area within the reporting unit, and the percentage of the reporting unit's population that is in a floodplain.

import arcpy
arcpy.ImportToolbox(r"D:\Destination Folder\ATtILA v2.tbx")

Reporting_unit_feature = r"D:\pyexamples\data.gdb\Watersheds"
Reporting_unit_ID_field = "HUC_12"
Population_raster_or_polygon_feature = r"D:\pyexamples\data.gdb\Census2010"
Population_field = "TOTALPOP"
Floodplain_raster_or_polygon_feature = r"D:\pyexamples\data.gdb\Floodplain_Raster"
Output_table = r"D:\pyexamples\results.gdb\Watersheds_PIFM"
Select_options = "'INTERMEDIATES  -  Retain Intermediate Layers Generated During Metric Calculation'"


arcpy.ATtILA.PIFM(Reporting_unit_feature,
                  Reporting_unit_ID_field,
                  Population_raster_or_polygon_feature,
                  Population_field,
                  Floodplain_raster_or_polygon_feature,
                  Output_table,
                  Select_options)

Population in Floodplain Metrics example 2 (Tool Details Messages)

This is a sample capture of the geoprocessing messages generated during a typical tool run. It is provided here to assist in the understanding of the tool's processing steps.


Start Time: Day, Month dd, yyyy hh:mm:ss AM/PM
Started: yyyy-mm-dd hh:mm:ss Setting up environment variables
Intermediates are stored in this directory: workspace path
Time: yyyy-mm-dd hh:mm:ss Calculating population within each reporting unit
Time: yyyy-mm-dd hh:mm:ss Converting floodplain raster to a polygon feature
Time: yyyy-mm-dd hh:mm:ss Assigning reporting unit IDs to flood plain features
Time: yyyy-mm-dd hh:mm:ss Calculating population within floodplain areas for each reporting unit
Time: yyyy-mm-dd hh:mm:ss Calculating the percent of the population that is within a flood plain
Time: yyyy-mm-dd hh:mm:ss Calculation complete
Succeeded at Day, Month dd, yyyy hh:mm:ss AM/PM (Elapsed Time: ##.## units)

Tags

There are no tags for this item.

Credits

There are no credits for this item.

Use Limitations

There are no access and use limitations for this item.


arrow_up Top of the page     |     arrow_left Population Density Metrics     |     arrow_right Population Land Cover Views


⚠️ **GitHub.com Fallback** ⚠️