Square Grids In Polygons

Running programmatically

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

Square Grids In Polygons

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

Square Grids In Polygons

Original polygons labeled with the values in field to be used as a source for the Cell Size. Rotational angle = 0, Completely inside = TRUE

Square Grids In Polygons

Running Programmatically

(Go to TOP)

Parameters

Expression Explanation
Function Name SquareGridsInPolygons
<input dataset> A String representing the input layer. Must be of Polygon type.
<output dataset> A String - the full name of the output layer.
{Size} A Double representing grid cell size
{Size Field} A String representing the name of a field in the in the attribute table of the input dataset. The field has the values for the cell size of the grid polygons to be created.
<Angle From> Required. A String -This parameter defines what will be the source rotation of the grids:
  • "Constant" - user defined value for all grids.
  • "FromField" - different for each grid based on a value in the attribute table.
  • "LongestAxis" - the grids will be oriented along the longest axis of each polygon.
  • "LongestSide" - the grids will be oriented along the longest side of each polygon.
{Angle} A Double representing the rotation angle of the grids
{Angle Field} A String representing the name of a field in the in the attribute table of the input dataset field name. The field has the values for the angle of the grids to be created.
{Inside Only} A Boolean indicating whether all cells to be only inside the polygons.

Running the function

ETGWPath used in the table below is the full path to ETGWRun.exe (E.G. "C:\Program Files\ETSpatial Techniques\ETGeo Wizards\ETGWRun.exe")

Language Syntax
Python subprocess.call( [ETGWPath, "SquareGridsInPolygons", "input dataset", "output dataset", "Size", "", "Angle From", "Angle", "", "Inside Only"])
.NET using ETGWRun.exe StartInfo.FileName = ETGWPath
StartInfo.Arguments = "SquareGridsInPolygons" "input dataset" "output dataset" "Size" "" "Angle From" "Angle" "" "Inside Only"
.NET using ETGWOutX.dll SquareGridsInPolygons(input dataset, output dataset, Size, "", Angle From, Angle, "", Inside Only)
ArcPy arcpy.SquareGridsInPolygons(input dataset, output dataset , "Size", "", "Angle From", "Angle", "", "Inside Only")

Notes:

(Go to TOP)