Create Mobile Scene Package (Data Management)

Summary

Creates a mobile scene package file (.mspk) from one or more scenes for use across the ArcGIS platform.

Usage

  • Mobile scene packages can be used in ArcGIS Pro and by developers building applications with ArcGIS Runtime SDK. For ArcGIS Runtime SDK, .mspk files were introduced at version 100.5. Mobile scene packages are supported as a file type in ArcGIS Online and Portal for ArcGIS 10.7 and later. See Share a mobile scene package for more information.

  • Mobile scene packages can be imported into ArcGIS Pro using Import Map Import Map on the Insert tab in the Project group.

  • When creating a mobile scene package, all scenes and data layers will be projected to a common coordinate system. The coordinate system that will be used is the coordinate system of the scene. If there are multiple scenes, the first input scene coordinate system will be used. Faster processing time can be achieved by ensuring that all datasets are in the same coordinate system. Currently, ArcGIS Runtime SDK applications only support global scenes in the WGS84 and Web Mercator Auxiliary Sphere coordinate systems.

  • If the scene contains service layers, scene layer packages (.slpk file) or tile packages (.tpk file), ensure that their coordinate system matches the scene's coordinate system in the scene properties. Packages that have a coordinate system other than that of the scene will be blocked from the mobile scene package. Both the horizontal (XY) coordinate system and vertical coordinate (Z) system must match the scene's coordinate system. See Specify a coordinate system for detailed steps on updating a scene's coordinate system.

  • If the scene contains a network layer that references a network dataset, it will be included in the mobile scene package as a transportation network for routing and driving directions. All feature classes and tables that the network references will become part of the mobile scene package. This may include layers that are not part of the scene. For example, if there is only a network layer in the map, the package will include the streets, junctions, and turns feature classes associated with the network. See Author a mobile scene package for ArcGIS Runtime for additional considerations.

  • You can use the interactive edit tool to define the area of interest by drawing a rectangle on the ground of the scene. If an extent is not specified, the current scene extent will be used to define the area of interest (AOI) and consolidate only those features that intersect that extent. See Area of interest considerations for details.

  • Mobile scene packages are optimized for 3D visualization, and multipatch feature layers, 3D point feature layers, and LAS dataset layers will be converted to scene layer packages for fast drawing. See Operational layers for more information on how layers are packaged in a mobile scene package.

  • The following table lists supported input data and how the output data is converted or copied in the mobile scene package. It also lists whether the data can be reprojected to the scene's coordinate system. Datasets that cannot be reprojected will be blocked as input to the Create Mobile Scene Package tool.

    Source datasetDataset in mobile scene packageReprojection of dataset supported

    2D Point, Line, or Polygon Feature Layer

    SQLite Feature Class

    Yes

    3D Point Feature Layer

    Scene Layer Package

    Yes

    Multipatch Feature Layer

    Scene Layer Package

    Yes

    LAS Dataset Layer

    Scene Layer Package

    Yes

    Scene Layer Package

    Scene Layer Package

    No

    Raster Layer

    Raster Dataset

    Yes

    Elevation Source

    Tile Package or Raster Dataset

    Yes for Raster Dataset

    Tile Package

    Tile Package

    No

    Network Layer

    Transportation Network

    Yes

    KMZ or KML

    KMZ or KML

    No

    Table

    SQLite Table

    No

    Service Layer

    Service Layer

    No

    Caution:
    Scenes that contain large or many datasets may require significant processing time to convert the data for use in the mobile scene package.

Syntax

arcpy.management.CreateMobileScenePackage(in_scene, output_file, {in_locator}, {area_of_interest}, {extent}, {clip_features}, {title}, {summary}, {description}, {tags}, {credits}, {use_limitations}, {anonymous_use}, {texture_optimization}, {enable_scene_expiration}, {scene_expiration_type}, {expiration_date}, {expiration_message}, {select_related_rows}, {reference_online_content})
ParameterExplanationData Type
in_scene
[in_scene,...]

One or more local or global scenes that will be packaged into a single .mspk file. Active scenes and .mapx files can be added as input.

Map
output_file

The output mobile scene package .mspk file.

File
in_locator
[in_locator,...]
(Optional)

One or more locators (.loc) that will be included in the mobile scene package.

Note:
Locators have the following restrictions:
  • The locator must be created with ArcGIS 10.0 or later.
  • The locator cannot have an unknown coordinate system.
  • The locator or any participating locator in a composite locator cannot be a geocoding service, including services from ArcGIS Enterprise or ArcGIS Online.
  • The locator cannot contain a custom plug-in in the locator style configuration.
Address Locator
area_of_interest
(Optional)

A polygon layer that defines the area of interest. Only those features that intersect the area of interest will be included in the mobile scene package.

Feature Layer
extent
(Optional)

Specifies the extent that will be used to select or clip features.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
clip_features
(Optional)

Specifies whether the output features will be clipped to the given area of interest or extent.

  • Checked—The geometry of the features will be clipped to the given area of interest or extent.
  • Unchecked—Features in the scene will be selected and their geometry will remain unaltered. This is the default.
Note:

Multipatch feature layers, 3D point feature layers, LAS dataset layers, service layers, tile packages, and scene layer packages, cannot be clipped and will be completely copied to the mobile scene package.

Specifies whether the output features will be clipped to the given area of interest or extent.

  • CLIPThe geometry of the features will be clipped to the given area of interest or extent.
  • SELECT Features in the map will be selected and their geometry will remain unaltered. This is the default.
Note:

Multipatch feature layers, 3D point feature layers, LAS dataset layers, tile packages, and scene layer packages, cannot be clipped and will be completely copied to the mobile scene package.

Boolean
title
(Optional)

Adds title information to the properties of the package.

String
summary
(Optional)

Adds summary information to the properties of the package.

String
description
(Optional)

Adds description information to the properties of the package.

String
tags
(Optional)

Adds tag information to the properties of the package. Multiple tags can be added, separated by a comma or semicolon.

String
credits
(Optional)

Adds credit information to the properties of the package.

String
use_limitations
(Optional)

Adds use limitations to the properties of the package.

String
anonymous_use
(Optional)

Specifies whether the mobile scenes can be used by anyone or only those with an ArcGIS account.

  • ANONYMOUS_USEAnyone with access to the package can use the mobile scene without signing in with an Esri named user account.
  • STANDARDAnyone with access to the package must be signed in with a named user account to use the mobile scene. This is the default.
License:

This optional parameter is only available with the Publisher extension.

Boolean
texture_optimization
(Optional)

Specifies the texture optimization that will be used. Textures are optimized according to the target platform where the scene layer package will be used. This parameter applies to scene layer packages only.

Caution:

Optimizations that include ETC2 may take significant time to process. For fastest results, use Desktop or None.

  • ALLAll texture formats including JPEG, DXT, and ETC2 for use in desktop, web, and mobile can be used.
  • DESKTOPWindows-, Linux-, and Mac-supported textures including JPEG and DXT can be used in the ArcGIS Pro client on Windows and ArcGIS Runtime desktop clients on Windows, Linux, and Mac. This is the default.
  • MOBILEAndroid- and iOS-supported textures including JPEG and ETC2 can be used in ArcGIS Runtime mobile applications.
  • NONEJPEG textures can be used in desktop and web platforms.
String
enable_scene_expiration
(Optional)

Specifies whether the mobile scene package will time out.

  • ENABLE_SCENE_EXPIRATIONTime-out is enabled on the mobile scene package.
  • DISABLE_SCENE_EXPIRATIONTime-out is not enabled on the mobile scene package. This is the default.
License:

This optional parameter is only available with the Publisher extension.

Boolean
scene_expiration_type
(Optional)

Specifies the type of scene access for the expired mobile scene package.

  • ALLOW_TO_OPENThe user of the package will be warned that the scene has expired, and allowed to open the scene. This is the default.
  • DONOT_ALLOW_TO_OPENThe user of the package will be warned that the scene has expired and will not be allowed to open the package.
License:

This optional parameter is only available with the Publisher extension.

String
expiration_date
(Optional)

The date the mobile scene package will expire.

License:

This optional parameter is only available with the Publisher extension.

Date
expiration_message
(Optional)

A text message will appear when an expired scene is accessed.

License:

This optional parameter is only available with the Publisher extension.

String
select_related_rows
(Optional)

Specifies whether the specified extent will be applied to related data sources.

  • KEEP_ONLY_RELATED_ROWSOnly related data corresponding to records within the specified extent will be consolidated.
  • KEEP_ALL_RELATED_ROWSRelated data sources will be consolidated in their entirety. This is the default.
Boolean
reference_online_content
(Optional)

Specifies whether service layers will be referenced in the package.

  • INCLUDE_SERVICE_LAYERSService layers will be referenced in the mobile package.
  • EXCLUDE_SERVICE_LAYERSService layers will not be referenced in the mobile package. This is the default.
Boolean

Code sample

CreateMobileScenePackage example 1 (Python window)

The following script demonstrates how to use the CreateMobileScenePackage tool in the Python window.

import arcpy
arcpy.env.workspace = r'c:\data'
arcpy.management.CreateMobileScenePackage(
    'loma_linda','LomaLindaBuilding.mspk', None, None, 'DEFAULT', 'SELECT', 
    'Loma Linda Proposed Building', 
    'Offline mobile scene package for planning department', None, 'mspk', None, 
    None, 'STANDARD', 'DESKTOP', 'ENABLE_SCENE_EXPIRATION', 'ALLOW_TO_OPEN',
    '12/31/2019 9:00:00 AM', 'This scene is expired. Contact admin@email.com',
    'EXCLUDE_SERVICE_LAYERS')
CreateMobileScenePackage example 2 (stand-alone script)

The following script demonstrates how to use the CreateMobileScenePackage tool in a Python script.

import arcpy

arcpy.env.workspace = r'c:\data'
arcpy.management.CreateMobileScenePackage(
    'Yosemite.mapx','YosemiteOffline.mspk', None, None, 'DEFAULT', 'SELECT', 
    'YosemiteOfflineScene', 
    'Offline mobile scene package for Yosemite National Park', None, 
    'mspk, yosemite, offline', None, None, 'STANDARD', 'DESKTOP', 
    'DISABLE_SCENE_EXPIRATION', 'ALLOW_TO_OPEN')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Limited
  • Standard: Limited
  • Advanced: Limited

Related topics