Create Fishnet by Number of Rows and Columns
Description
Generates a fishnet based on the user specified number of rows and columns. Rows are defined along the height (shorter side) of the outline rectangle, while columns are defined along the width (longer side) of the outline rectangle. The cell size of the fishnet is calculated internally in a way to completely fill in the outline rectangle with the specified numbers of rows and columns. The following figures demonstrate this process and the final fitted fishnet. iRow and iColumn fields are created and populated in the resulting fishnet feature class.
The tools is implemented as a Python script tool performing a two-step process:
The tool first fits an outline rectangle to the input feature class. This is accomplished using "Minimum Bounding Geometry" gp tool. The result is an outline rectangle that fits the input polygon in such a way to minimize the height (shorter side) of the rectangle. This mimics the identification of minor and major "axes" of the input polygon. The outline rectangle contains MBG_Width, MBG_Length, and MBG_Orientation attributes that define the rectangle properties. This is a temporary feature class and is not saved by the tool.
The properties of the outline rectangle (its origin geometry and attributes) are then used to calculate parameters for the "Create Fishnet" gp tool.
The tool will generate two fields, iRow and iColumn, with row and column index for each fishnet polygon.
Usage
The resulting fishnet is stored in the same geodatabase/feature dataset as the input feature class if only the name of the resulting layer is provided, or in the user specified location if a full path is provided.
Parameters
Parameter Name | Data Type | Direction | Type | Dialog Reference |
---|---|---|---|---|
Input feature class | Feature Layer | Input | Required | Can be of any type (point, line, polygon). |
Input number of rows | Long | Input | Required | Number of rows (along shorter outline rectangle axis). |
Input number of columns | Long | Input | Required | Number of columns (along longer outline rectangle axis). |
Output feature class name | Feature Layer | Output | Required | Name of the output feature class. The fishnet feature class will be placed in the same location as the input feature class if only the name of the resulting layer is provided, or in the user specified location if a full path is provided. |