Generate Product Layout (Topographic Production)

Summary

Automates the process of producing a layout or map based on a standard specification.

Note:

A product file installer is available for ArcGIS Production Mapping and ArcGIS Defense Mapping. The product files contain predefined layout PAGX templates that can be used for cartographic production.

Learn more about Defense Mapping product files and Production Mapping product files.

Usage

  • The Product parameter list is provided as part of the product files installation and contains supported products and their properties. This is also the source of the list of versions supported for a selected product.

  • The tool will create feature classes and feature datasets in the Input Geodatabase as it creates the finished layout product.

  • The template layers in the Input Geodatabase must adhere to the data model of the selected product. For example, if the MTM product was selected, the template must have layers in it pointing to feature classes based on the MTM data model, and the Input Geodatabase must adhere to the MTM data model.

    If the tool encounters an Input Geodatabase layer for which it cannot find a matching feature class, a warning is provided and that layer will include a broken data source in the final layout template.

Parameters

LabelExplanationData Type
Input Geodatabase

The input geodatabase that contains the features for the final map product. The schema of the workspace must match the schema of the product selected.

Workspace
Area Of Interest

A polygon feature layer that describes the processing extent. The feature layer must have only one feature selected or must be a feature class with only one feature.

Feature Layer
Product

The list of supported map products.

String
Version

The list of supported versions for the selected product.

String
Output Location

The full folder path to which the output .pagx file will be written.

Folder
Input Rasters
(Optional)

The input rasters used if the product requires an elevation guide surround element to calculate the elevation bands and spot height features. If you specify more than one raster, the rasters must have the same cell size, band number, and pixel type. If no raster is specified, the tool will not process the elevation guide data frame and will give a warning.

Raster Layer; Mosaic Layer
Layout Template
(Optional)

The layout template to be used. If no layout template is specified, the default layout template for the product will be used.

Layout

Derived Output

LabelExplanationData Type
Layout Template

The template representing the final topographic map.

Layout

arcpy.topographic.GenerateProductLayout(geodatabase, aoi_layer, product, version, output_location, {rasters}, {template})
NameExplanationData Type
geodatabase

The input geodatabase that contains the features for the final map product. The schema of the workspace must match the schema of the product selected.

Workspace
aoi_layer

A polygon feature layer that describes the processing extent. The feature layer must have only one feature selected or must be a feature class with only one feature.

Feature Layer
product

The list of supported map products.

String
version

The list of supported versions for the selected product.

String
output_location

The full folder path to which the output .pagx file will be written.

Folder
rasters
[rasters,...]
(Optional)

The input rasters used if the product requires an elevation guide surround element to calculate the elevation bands and spot height features. If you specify more than one raster, the rasters must have the same cell size, band number, and pixel type. If no raster is specified, the tool will not process the elevation guide data frame and will give a warning.

Raster Layer; Mosaic Layer
template
(Optional)

The layout template to be used. If no layout template is specified, the default layout template for the product will be used.

Layout

Derived Output

NameExplanationData Type
out_template

The template representing the final topographic map.

Layout

Code sample

GenerateProductLayout example (stand-alone script)

The following Python window script demonstrates how to use the GenerateProductLayout function to automate the process of producing a layout or map based on a standard specification.

# Name: GenerateProductLayout_sample.py
# Description: Automates the process of producing a layout or map based on a standard specification.

# Import System Modules
import arcpy

# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
arcpy.CheckOutExtension('Spatial')

# Setting the environment
arcpy.env.overwriteOutput = True

# Making AOI Feature Layer
Index = r'C:\Data\ReferenceData\MapIndex.gdb\MapIndex\TLM50_Index'
arcpy.management.MakeFeatureLayer(Index, "TLM50_Index")

# Selecting a single AOI from the AOI feature layer
selection_string = "NRN = 'V795X16573'"
arcpy.management.SelectLayerByAttribute("TLM50_Index", "NEW_SELECTION", selection_string)

# Setting Local Variables
geodatabase = r'C:\Data\MGCP_TRD_4_5.gdb'
aoi_layer = "TLM50_Index"
product = "MTM50"
version = "TRD_4_5"
output_location = r'C:\Data\Output'
rasters = r'C:\Data\Monterey.dt2'
template = r'C:\Data\MTM50_Layout.pagx'

# Calling the Generate Product Layout tool to produce a layout for an MTM50 product
arcpy.topographic.GenerateProductLayout(geodatabase, aoi_layer, product, version, output_location, rasters, template)

# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))

# Check In Extensions
arcpy.CheckInExtension('Foundation')
arcpy.CheckInExtension('Spatial')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Requires Production Mapping and ArcGIS Spatial Analyst extension
  • Advanced: Requires Production Mapping and ArcGIS Spatial Analyst extension

Related topics