Create Mobile Scene Package (Data Management)

Summary

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

Usage

  • Mobile scene packages can be used in ArcGIS AllSource and by developers building applications with ArcGIS Maps SDKs. 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 AllSource 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 Maps SDKs applications only support global scenes in the WGS84 and Web Mercator Auxiliary Sphere coordinate systems.

  • If the scene contains service layers, vector tile packages (.vtpk file), or tile packages (.tpk file), ensure that their coordinate system matches the scene's coordinate system in the scene properties or basemap coordinate system. Packages that have a coordinate system other than that of the scene will be blocked from the mobile scene package. Both the horizontal (x,y) coordinate system and vertical coordinate (z) system must match the scene's coordinate system. See Work with coordinate systems 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 Maps SDKs for additional considerations.

  • You can use the interactive edit tool to define the area of interest (AOI) 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 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 in mobile scenes 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.

    SourceDataset in mobile scene packageReprojection of data 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

    3D Tiles Layer

    3TZ

    No

    Scene Layer Package

    Scene Layer Package

    Yes

    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.

Parameters

LabelExplanationData Type
Input 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
Input Locator
(Optional)

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

Note:
Locators have the following restrictions:
  • 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.
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.

  • Current Display Extent Map View—The extent will be based on the active map or scene. This option is only available when there is an active map.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene. This option will create a feature class in the project geodatabase and add a layer to the map. The feature class will have the same coordinate system as the map.
    Note:

    This option is not available in the Environments dialog box. It is only available from a tool parameter with an extent data type or from the Environments tab on a tool dialog box.

    Note:

    When the Enable and disable editing from the Edit tab editing option is checked, you must enable editing on the Edit ribbon tab to draw the extent.

  • Extent of a Layer Layer—The extent will be based on an active map layer. Use the drop-down list to choose an available layer or use the Extent of data in all layers option to get the combined extent of all active map layers, excluding the basemap. This option is only available when there is an active map with layers.

    Each map layer has the following options:

    • All Features Select All—The extent of all features in the layer.
    • Selected Features Area from Selected Features—The extent of the selected features in the layer.
    • Visible Features Extent Indicator—The extent of visible features in the layer.
      Note:

      The extents from the Selected Features Area from Selected Features and Visible Features Extent Indicator options are only available for feature layers.

  • Browse Browse—The extent will be based on an existing dataset.
  • Intersection of Inputs Intersect—The extent will be based on the minimum or intersecting extent of all inputs. If no inputs overlap, a null extent with all zeros will result.
  • Union of Inputs Union—The extent will be based on the maximum or combined extent of all inputs.
  • Clipboard Paste—The extent can be copied to and from the clipboard.
    • Copy Extent Copy—Copies the extent coordinates and coordinate system to the clipboard.
    • Paste Extent Paste—Pastes the extent coordinates and, optionally, the coordinate system from the clipboard. If the clipboard values do not include a coordinate system, the extent will use the map’s coordinate system.
    Note:

    The extent coordinates are copied to and pasted from the clipboard using the same formatting and order as the ArcPy Extent object: x-min, y-min, x-max, y-max, and the spatial reference.

  • Reset Extent Reset—The extent will be reset to the default value.
  • Manually entered coordinates—The coordinates must be numeric values and in the active map's coordinate system.
    Caution:

    The map may use different display units than the entered coordinates. The use of a cardinal direction (N, S, E, W) is not supported. Use a negative value sign for south and west coordinates.

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, and tile packages cannot be clipped and will be completely copied to the mobile scene package.

Boolean
Title
(Optional)

Title information that will be added to the properties of the package.

String
Summary
(Optional)

Summary information that will be added to the properties of the package.

String
Description
(Optional)

Description information that will be added to the properties of the package.

String
Tags
(Optional)

Tag information that will be added to the properties of the package. Multiple tags can be added, separated by a comma or semicolon.

String
Credits
(Optional)

Credit information that will be added to the properties of the package.

String
Use Limitations
(Optional)

Use limitations that will be added to the properties of the package.

String
Enable Anonymous Use
(Optional)

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

  • Checked—Anyone with access to the package can use the mobile scene without signing in with an Esri named user account.
  • Unchecked—Anyone 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 textures that will be optimized according to the target platform where the scene layer package is used.

Caution:

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

  • AllAll texture formats will be optimized including JPEG, DXT, and KTX2 for use in desktop, web, and mobile platforms.
  • DesktopWindows, Linux, and Mac supported textures will be optimized including JPEG and DXT for use in ArcGIS AllSource clients on Windows and ArcGIS Maps SDKs desktop clients on Windows, Linux, and Mac. This is the default.
  • MobileAndroid and iOS supported textures will be optimized including JPEG and KTX2 for use in ArcGIS Maps SDKs mobile applications.
  • NoneJPEG textures will be optimized for use in desktop and web platforms.
String
Enable Scene Expiration
(Optional)

Specifies whether the mobile scene package will time out.

  • Checked—Time-out functionality will be enabled on the mobile scene package.
  • Unchecked—Time-out functionality will not be 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 that will be used 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.
  • Do not 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)

The text message that will appear when an expired scene is accessed.

License:

This optional parameter is only available with the Publisher extension.

String
Keep only the rows which are related to features within the extent
(Optional)

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

  • Unchecked—Related data sources will be consolidated in their entirety. This is the default.
  • Checked—Only related data corresponding to records within the specified extent will be consolidated.
Boolean
Reference Online Content
(Optional)

Specifies whether service layers will be referenced in the package.

  • Unchecked—Service layers will not be referenced in the mobile package. This is the default.
  • Checked—Service layers will be referenced in the mobile package.

Boolean

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})
NameExplanationData 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 file) that will be included in the mobile scene package.

Note:
Locators have the following restrictions:
  • 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.
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, and tile 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, and tile packages cannot be clipped and will be completely copied to the mobile scene package.

Boolean
title
(Optional)

Title information that will be added to the properties of the package.

String
summary
(Optional)

Summary information that will be added to the properties of the package.

String
description
(Optional)

Description information that will be added to the properties of the package.

String
tags
(Optional)

Tag information that will be added to the properties of the package. Multiple tags can be added, separated by a comma or semicolon.

String
credits
(Optional)

Credit information that will be added to the properties of the package.

String
use_limitations
(Optional)

Use limitations that will be added 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 textures that will be optimized according to the target platform where the scene layer package is used.

Caution:

Optimizations that include KTX2 may take significant time to process. For fastest results, use the DESKTOP or NONE options.

  • ALLAll texture formats will be optimized including JPEG, DXT, and KTX2 for use in desktop, web, and mobile platforms.
  • DESKTOPWindows, Linux, and Mac supported textures will be optimized including JPEG and DXT for use in ArcGIS AllSource clients on Windows and ArcGIS Maps SDKs desktop clients on Windows, Linux, and Mac. This is the default.
  • MOBILEAndroid and iOS supported textures will be optimized including JPEG and KTX2 for use in ArcGIS Maps SDKs mobile applications.
  • NONEJPEG textures will be optimized for use in desktop and web platforms.
String
enable_scene_expiration
(Optional)

Specifies whether the mobile scene package will time out.

  • ENABLE_SCENE_EXPIRATIONTime-out functionality will be enabled on the mobile scene package.
  • DISABLE_SCENE_EXPIRATIONTime-out functionality will not be 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 that will be used 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)

The text message that 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 function 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 function 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

Special cases

Parallel Processing Factor

If the Parallel Processing Factor value is empty (blank), the tool will run with a default value of 50 percent (one-half) of the available cores.

Related topics