Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

GRG From Point

Chris Moore edited this page May 15, 2018 · 3 revisions

GRG FROM POINT

Test Case Name

GRGCreateGRGFromPointTestCase

Test Case Description

Test the GP Tool: Military Tools (Toolbox) | Gridded Reference Graphic (Toolset) | CreateGRGFromPoint (Tool)

Test Case Location

https://github.com/Esri/military-tools-geoprocessing-toolbox/blob/dev/utils/test/grg_tests/GRGCreateGRGFromPointTestCase.py

Tests

Test 1

Test Name

testGRGPointTarget

Test Description

A basic test of CreateGRGFromPoint. Calls GRG with an input point and checks that the output matches the expected values given the input parameters

Example Test Command

pointInput = 'testdata\MilitaryToolsTestData.gdb\GRGCenterPoint'
rows = 5
cols = 10
cellWidth = 100
cellHeight = 100
cellUnits = "Meters"
labelStart = "Lower-Left"
labelStyle = "Alpha-Numeric"
labelSeparator = "-" 
gridRotationAngle = 0

CreateGRGFromPoint_mt(pointInput, rows, cols, 
                cellWidth, cellHeight, cellUnits, 
                labelStart, labelStyle, labelSeparator, gridRotationAngle, output_featureClass)

CHECKS

Check 1

Does the tool output match the expected value and is the output feature class created?

Check 2

Is the expected number of features created? count = (row X cols)

Check 3

Check the perimeter length of each feature - is it the expected value?

Notes: each row shape length = (2 x width) + (2 x height)

Check 4

Does value in Grid field match the Label Properties type? (Alpha-Numeric)

Test 2

Test Name

testGRGPointTarget_Numeric

Test Description

A basic test of CreateGRGFromPoint. Calls GRG with an input Point and checks that the output matches the expected values given the input parameters. Same as testGRGPointGRG but checks that numeric grid labels are produced

Example Test Command

pointInput = 'testdata\MilitaryToolsTestData.gdb\GRGCenterPoint'
rows = 10
cols = 20
cellWidth = 100
cellHeight = 200
cellUnits = "Meters"
labelStart = "Lower-Left"
labelStyle = "Numeric"    # <---- Primary Test Parameter
labelSeparator = "-" 
gridRotationAngle = 0

CreateGRGFromPoint_mt(pointInput, rows, cols, 
                cellWidth, cellHeight, cellUnits, 
                labelStart, labelStyle, labelSeparator, gridRotationAngle, output_featureClass)

CHECKS

Check 1

Does the tool output match the expected value and is the output feature class created?

Check 2

Is the expected number of features created? count = (row X cols)

Check 3

Check the perimeter length each feature - is it the expected value?

Notes: each row shape length = (2 x width) + (2 x height)

Check 4

Does value in Grid field match the Label Properties type? (Numeric)

Test 3

Test Name

testGRGPointTarget_Rotated

Test Description

A basic test of CreateGRGFromPoint when rotation angle is specified. Calls GRG with an input Point and rotation angle and checks that the output matches the expected values given the input parameters.

Example Test Command

pointInput = 'testdata\MilitaryToolsTestData.gdb\GRGCenterPoint'
rows = 5
cols = 10
cellWidth = 100
cellHeight = 100
cellUnits = "Meters"
labelStart = "Lower-Left"
labelStyle = "Numeric"
labelSeparator = "-" 
gridRotationAngle = 10   <---- Primary Test Parameter

CreateGRGFromPoint_mt(pointInput, rows, cols, 
                cellWidth, cellHeight, cellUnits, 
                labelStart, labelStyle, labelSeparator, gridRotationAngle, output_featureClass)

CHECKS

Check 1

Does the tool output match the expected value and is the output feature class created?

Check 2

Is the expected number of features created? count = (row X cols)