Summary
Consolidates feature layers, basemaps, network datasets, and locators from your map document into a single folder and prepares the folder for use within applications built with ArcGIS Runtime SDKs. This folder can then be provisioned to devices to use with applications that run offline (applications that can run disconnected from ArcGIS Server or ArcGIS Online).
Usage
If an extent is not specified, the layers within your map document will be clipped to the extent stored within your map document. To ensure that all features are copied to your ArcGIS Runtime content, specify UNION_OF_INPUTS for the Extent parameter.
- Only simple features, tables, relationship classes, locators, and network datasets are supported for Runtime content. If a feature layer references or participates in a relationship class that references unsupported data, the layer will not be included in the Runtime content.
Runtime content does not support data layers from multiple workspaces; therefore, all of the layers in the map document must belong to the same workspace.
All layers in the Runtime content will be projected into the spatial reference of the map document's data frame. If a basemap layer is included, the layers will be projected to the spatial reference of the basemap layer's tiling scheme.
If a basemap layer is included, it will be used to create tile caches that can be used as a basemap layer within your Runtime application. Tile caches typically display more quickly than other basemaps. Including a basemap will increase the time it takes your Runtime content to be consolidated.
Data from feature services and map services cannot be used. For more information on using services in your ArcGIS Runtime SDKs, see Services Pattern.
Syntax
arcpy.management.CreateRuntimeContent(in_map, output_folder, {in_basemap}, {in_locator}, {extent}, {options}, optimize, service_type, format_type, level_of_detail, {service_file})
Parameter | Explanation | Data Type |
in_map | The input map document (.mxd) that will be consolidated into a single folder. | ArcMap Document |
output_folder | The output folder that will contain the consolidated data. This folder can then be deployed to mobile devices to be used within ArcGIS Runtime-based applications. | Folder |
in_basemap (Optional) | Input basemap layer that will be included in the Runtime content. | String |
in_locator (Optional) | Input locator (.loc) that will be included in the Runtime content. | Address Locator |
extent (Optional) | Specifies the extent by manually entering the coordinates in the extent parameter using the format X-Min Y-Min X-Max Y-Max. To use the extent of a specific layer, specify the layer name.
| Extent |
options [options,...] (Optional) | Options for determining which layers will be included in the Runtime content.
If your map contains a network dataset or a network analysis layer, you have the option of including the network dataset in your Runtime content as a transportation network. When including a network, all feature layers the network references become part of the Runtime content. This may include layers that are not part of the map. For example, if you only have a network dataset layer in the map, your runtime content includes the streets, junctions, and turns feature classes associated with the network. For a network dataset to become a transportation network, there are a few restrictions to keep in mind:
When using Python, multiple values can be entered by using a Python list, for example, ["NETWORK_DATA", "FEATURE_AND_TABULAR_DATA"]. | String |
optimize | Optimizes the Runtime content by reducing its size for portability to mobile devices.
Optimization includes deleting all fields that are not used in renderers, relates, or joins. OBJECTID, SHAPE, and GlobalIDs are always maintained. Additionally, OPTIMIZE_SIZE will set the precision of the of the spatial reference to 0.1 meters. | Boolean |
service_type | Determines whether the tiling scheme will be generated from an existing map service or if map tiles will be generated for ArcGIS Online, Bing Maps, and Google Maps.
| Boolean |
format_type | Specifies the format of the generated tiles.
| String |
level_of_detail | Specify the number of scale levels at which tiles will be generated for the package. Possible values are 1 through 20. | Long |
service_file (Optional) | Specifies the name of the map service or the XML files to use for the tiling scheme. This parameter is required only when the service_type parameter is EXISTING. | MapServer; File |
Code sample
CreateRuntimeContent example 1 (Python window)
This is a Python sample for the CreateRuntimeContent tool that includes a basemap layer.
arcpy.CreateRuntimeContent_management("D:/Geoprocessing/OfflineMapping/sandiego_locators_basemap.mxd","D:/Geoprocessing/Results/RRuntimeContent_sandiego", "MyBasemapLayer", "#", "#", "FEATURE_AND_TABULAR_DATA", "NON_OPTIMIZE_SIZE", "ONLINE", "PNG", "1", "#")
CreateRuntimeContent example 2 (Python window)
This is a Python sample for the CreateRuntimeContent tool that sets the extent to the union of inputs.
arcpy.CreateRuntimeContent_management("//qalab_server/pydata/v1021/packaging/global/mxds/filegeodatabase_redlands.mxd","D:/Geoprocessing/Results/RT_Redlands", "#", "#", "MAXOF", "NETWORK_DATA;FEATURE_AND_TABULAR_DATA", "OPTIMIZE_SIZE", "ONLINE", "PNG", "1", "#")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes