Open Table of Contents

Square Grids In Polygons

Go to ToolBox Implementation Go to .NET Implementation

Generates square grids located in the polygons of the input polygon dataset. The cell size for each polygon can be the same or different - based on the values in a numeric field of the input polygon feature class. The user can specify the rotation angle for the resulting square grids.

Inputs:

Outputs:

Illustration:

Cell size = 10, Rotational angle = "Along the longest side"
Completely inside = TRUE

sqGrid1

Original polygons labeled with the values in field to be used as a source for the Cell Size.
Rotational angle = "Along the longest Axis"
Completely inside = FALSE
sqGrid1
Original polygons labeled with the values in field to be used as a source for the Cell Size.
Rotational angle = 0
Completely inside = TRUE
sqGrid3

ToolBox implementation
(Go to TOP)

Command line syntax

ET_GPSquareGridsInPolygons<input_dataset>  <out_feature_class> {side_length} {side_length_field} {angle_from} {rotation_angle} {angle_field} {inside_only}

Parameters

Expression Explanation
<input_dataset> A Polygon feature class or feature layer
<out_feature_class> A String - the full name of the output feature class.
{side_length} A Double representing the cell size for all polygons
{side_length_field}  A String representing the name of a numeric field which values will be used to get the cell size for each polygon
{angle_from} A String defining how the rotation angle will be specified
  • "Constant" - Constant for all polygons - (in degrees starting from East anti-clockwise)
  • "From field" - different rotation angle for each field (in degrees starting from East anti-clockwise)
  • "Longest Axis" - Along the longest axis of each polygon
  • "Longest Side" - Along the longest side of each polygon
{rotation_angle} A Double - specifying the rotation angle for all polygons.
{angle_field} A String - the name of the field to be used as source for rotation angle.
{inside_only} A Boolean defining whether the resulting square can intersect the polygon boundary or not.

Scripting syntax

ET_GPSquareGridsInPolygons(input_dataset,  out_feature_class, side_length, side_length_field,  angle_from, rotation_angle, angle_field, inside_only)

See the explanations above:
<> - required parameter
{} - optional parameter

.NET implementation
(Go to TOP)

SquareGridsInPolygons(pInFC As IFeatureClass, sOutFName As String, sAngleFrom As String, Optional dCellSize As Double = 0, Optional sCellSizeField As String = "", Optional dAngle As Double = 0, Optional sAngleField As String = "", Optional bInsideOnly As Boolean = False) As IFeatureClass

Copyright Ianko Tchoukanski