ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Make Defense Grids and Graticules

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Generates a grids and graticules layer for Esri Defense Mapping products. This tool supports the creation of single, dual, and zipper zone grids. It simplifies grid creation by automatically populating several parameters based on a selected feature and an input grid type. It determines zone type and the correct grid .xml template used to generate the grids and graticules layer. It also determines a grid's primary and ancillary coordinate system and estimates reference scale and annotation mask margin.

Usage

  • Grid templates can be found in the <installation directory>\GridTemplates\DefenseMapping directory.

  • Input Area of Interest can only be a single polygon feature from a single feature layer. With a stand-alone script, you must use the Select Layer By Attribute tool.

  • When specifying a grid name that already exists in the output location, the existing grid will be overwritten.

  • The Primary Coordinate System is predefined in all Defense Mapping grid templates.

  • The Ancillary Coordinate System is often predefined in Defense Mapping grid templates. Dual grid templates require you to manually select the appropriate projected coordinate system.

  • During execution, this tool calls another geoprocessing tool, Feature Outline Masks. This creates a mask used to hide features along the edge of the grid. The mask improves cartographic display of annotation along the grid's edge. The output of Feature Outline Masks is added to the grid Feature Dataset.

Syntax

DefenseGrids(in_aoi_features, grid_type, template, in_workspace, in_dataset, use_field, grid_field, grid_string, primary_coord, ancillary_coord, reference_scale, mask_margin, anno_feature_class, {update_data_frame})
ParameterExplanationData Type
in_aoi_features

The feature layer that contains the selected feature used to determine the extent of the grid layer. The grid is created within this extent.

Layer
grid_type

Indicates the type of Defense Mapping cartographic product that will include the grid.

  • NONE —Custom grid type. Choose this option for a custom Grid Template .xml file.
  • EVC —Grids for EVC charts
  • ICM_3K —Grids for 3K ICMs
  • ICM_5K —Grids for 5K ICMs
  • ICM_5K+ —Grids for 5K–7.5K ICMs
  • ICM_10K —Grids for 10K ICMs
  • ICM_10K+ —Grids for 10K–15K ICMs
  • JOGA —Grids for JOG-A
  • LPC50 —Grids for 50K LPCs
  • TLM25 —Grids for 25K TLMs
  • TLM50 —Grids for 50K TLMs
  • TLM100 —Grids for 100K TLMs
  • TLM25_ELEVATION GUIDE —Grids for the TLM25 Elevation Guide
  • TLM50_ELEVATION GUIDE —Grids for the TLM50 Elevation Guide
  • TLM100_ELEVATION GUIDE —Grids for the TLM100 Elevation Guide
  • TLM25_BOUNDARY_GUIDE —Grids for the TLM25 Boundary Guide
  • TLM50_BOUNDARY_GUIDE —Grids for the TLM50 Boundary Guide
  • TLM100_BOUNDARY_GUIDE —Grids for the TLM100 Boundary Guide
  • TLM25_ADJOINING_SHEET_GUIDE —Grids for the TLM25 Adjoining Sheet Guide
  • TLM50_ADJOINING_SHEET_GUIDE —Grids for the TLM50 Adjoining Sheet Guide
  • TLM100_ADJOINING_SHEET_GUIDE —Grids for the TLM100 Adjoining Sheet Guide
String
template

Path to a grid .xml definition template. These templates store graphic properties for each grid layer. You can create new templates using the Production Mapping Grids and Graticules Designer or use existing templates located in the ArcGIS installation directory.

File
in_workspace

Workspace used in conjunction with the input Feature Dataset.

Workspace
in_dataset

The feature dataset that will store the features. This tool will create the feature dataset if it does not exist. Grid-specific feature classes will also be created if they do not already exist. If they already exist, and a grid with the same name and type as the one being created also exists, it will be overwritten.

String
use_field

Indicates whether a field name or string is appended to the end of the name of each feature class in the feature dataset. This allows you to store multiple grids in the same feature dataset.

  • FIELD —A field name from in_aoi_layer can be used as the grid name.
  • STRING —A custom string can be defined for the grid name.
Boolean
grid_field

The name of the field from in_aoi_features whose value is used as the grid name. This value is appended to the name of each feature class in the grid dataset. It is recommended that the NRN field be used.

Field
grid_string

The name for the cartographic grid created that allows for distinction between grids stored in the same feature dataset and set of feature classes.

String
primary_coord

Coordinate system for the grid layer being created. Typically, it will be the coordinate system of the final product or data frame. This coordinate system must be a projected coordinate system.

Spatial Reference
ancillary_coord

A secondary coordinate system in which grid components can be created.

Spatial Reference
reference_scale

The scale at which the grid is created and should be viewed. When the reference scale from the XML grid definition file is defined as Use Environment, the reference scale is derived in the following order:

  • The geoprocessing Reference Scale environment setting
  • The active data frame's reference scale
  • The active data frame's scale
  • The value from the XML grid definition file

Double
mask_margin

The amount of space that exists between the side of the annotation and the edge of the mask polygon feature. The units can be defined in page or map units. The default value depends on the specification (either 0.2 or 0.7 millimeters). This tool creates a mask with the default value, in page units, from the edge of any part of the grid annotation.

Linear unit
anno_feature_class

Name for the annotation mask feature class. The default annotation mask name uses the following naming convention: ANO_Masks_<feature dataset>_<grid name>. If the annotation mask name does not display a default name, it is likely that the Grid Name Field is blank or null.

String
update_data_frame
(Optional)

Indicates if the tool will update the data frame and layout using the grid settings.

  • NO_CONFIGURELAYOUT —Do not configure the data frame and layout. This is the default.
  • CONFIGURELAYOUT —Configure the data frame and layout.
Boolean

Code sample

DefenseGrids example 1 (stand-alone script)

The following code example demonstrates how to execute the DefenseGrids tool.

# Set gp environment
gridsWorkspace="c:/data/grids.gdb"
arcpy.env.workspace=gridsWorkspace
arcpy.env.addOutputsToMap=True

# variables for tools
idx="C:/Program Files (x86)/ArcGIS/EsriDefenseMapping/Desktop10.2/ReferenceData/MapIndex.mdb/MapIndex/TLM50_Index"
idxLayer = "TLM50_Index"
product="TLM50"
inTemplate="C:/Program Files (x86)/ArcGIS/Desktop10.2/GridTemplates/DefenseMapping/TLM50_Single.xml"
inDataset = "TLM50D"
outFeatures = "ANO_TLM50D_Masks_V795X22561"
useField="FIELD"
gridField="NRN"
coordsys="PROJCS['GCS WGS 1984 UTM Zone 11N (Calculated)',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]];IsHighPrecision"
ancillaryCoord="GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision"
refScale=50000
maskMargin="50 Meters"
where="[NRN] = 'V795X22561'"

# Make a feature layer from the TLM50_Index feature class
arcpy.MakeFeatureLayer_management(idx,idxLayer)

# Select a feature in which to create the grid
arcpy.SelectLayerByAttribute_management(idxLayer,"NEW_SELECTION", where)

# Generate grid
arcpy.DefenseGrids_defense(idxLayer, product, inTemplate, gridsWorkspace, inDataset, useField, gridField, "", coordsys, ancillaryCoord, refScale, maskMargin, outFeatures)
DefenseGrids example 2 (stand-alone script)

The following code example demonstrates how to execute the DefenseGrids tool.

# Running Defense Grids tool allowing the tool validation to populate parameters
# Importing arcpy module
import arcpy

# Checking out Defense extension
arcpy.CheckOutExtension('defense')

# Setting envioronment to allow overwrite output
arcpy.env.overwriteOutput = 1

# Setting variables for necessay data
area_of_interest = r'C:\DefenseProductFiles\ReferenceData\MapIndex.gdb\MapIndex\TLM50_Index'
grid_workspace = r'C:\Data\Grids.gdb'

# Setting variables for input parameters
grid_type = 'TM50'
grid_dataset = 'Grids'

# Createing AOI feature layer
selection_query = "NRN = 'V795X16573'"
arcpy.management.MakeFeatureLayer(area_of_interest, 'AOI')
arcpy.management.SelectLayerByAttribute('AOI', 'NEW_SELECTION', selection_query)

# Calling Defense Grids tool
arcpy.defense.DefenseGrids('AOI', grid_type, '#', grid_workspace, grid_dataset, 'FIELD', '#', '', '#', '#', '#', '#', '#', 'NO_CONFIGURELAYOUT')

# Checking in Defense extensison
arcpy.CheckInExtension('defense')

Environments

  • Current Workspace

Licensing information

  • ArcGIS Desktop Basic: No
  • ArcGIS Desktop Standard: No
  • ArcGIS Desktop Advanced: Requires Defense Mapping

Related topics

  • An overview of the Grids and Graticules toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2020 Esri. | Privacy | Legal