Resumen
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.
Uso
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.
Cuando especifique un nombre de la cuadrícula que ya existe en la ubicación de salida, la cuadrícula existente se sobrescribirá.
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.
Sintaxis
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})
Parámetro | Explicación | Tipo de datos |
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.
| 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.
| 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:
| 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 is 0.2 millimeters. This creates a mask that is 0.2 millimeters, 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 (Opcional) | Indicates if the tool will update the data frame and layout using the grid settings.
| Boolean |
Muestra de código
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')
Entornos
Información sobre licencias
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: No
- ArcGIS Desktop Advanced: Requiere Defense Mapping