CreateImageSDDraft (arcpy)

摘要

CreateImageSDDraft 函数是使用 ArcPy 自动发布镶嵌数据集或栅格数据集作为“影像服务”的第一步。通过 CreateImageSDDraft 创建的输出是服务定义草稿 (.sddraft) 文件。服务定义草稿由地理数据库中的镶嵌数据集或栅格数据集、服务器信息和一组服务属性组合而成。

服务器信息包括服务器连接或发布到的服务器类型,正在发布的服务的类型,服务的元数据(项目信息)和数据参考(是否向服务器复制数据)。

注注:

草稿服务定义不包含数据。草稿服务不能单独用于发布服务。

语法

CreateImageSDDraft (raster_or_mosaic_layer, out_sddraft, service_name, {server_type}, {connection_file_path}, {copy_data_to_server}, {folder_name}, {summary}, {tags})
参数说明数据类型
raster_or_mosaic_layer

The raster layer or mosaic layer that you want to publish.

String
out_sddraft

A string that represents the path and file name for the output Service Definition Draft (.sddraft) file.

String
service_name

A string that represents the name of the service. This is the name people will see and use to identify the service. The name can only contain alphanumeric characters and underscores. No spaces or special characters are allowed. The name cannot be more than 120 characters in length.

String
server_type

A string representing the server type. If a connection_file_path parameter is not supplied, then a server_type must be provided. If a connection_file_path parameter is supplied, then the server_type is taken from the connection file. In this case, you can choose FROM_CONNECTION_FILE or skip the parameter entirely.

  • ARCGIS_SERVERArcGIS for Server server type
  • FROM_CONNECTION_FILEGet the server_type as specified in the connection_file_path parameter

(默认值为 ARCGIS_SERVER)

String
connection_file_path

A string that represents the path and file name to the ArcGIS for Server connection file (.ags).

(默认值为 None)

String
copy_data_to_server

A Boolean that indicates whether the source data referenced by the mosaic dataset, the mosaic dataset itself, or the raster dataset published as image service will be copied to the server or not.

The copy_data_to_server parameter is only used if the server_type is ARCGIS_SERVER and the connection_file_path isn't specified. If the connection_file_path is specified, then the server's registered data stores are used. For example, if the workspace that contains the source data referenced by the mosaic dataset—the mosaic dataset itself or raster dataset registered with the server—then copy_data_to_server will always be False. Conversely, if the workspace that contains the source data referenced by the mosaic dataset—the mosaic dataset or raster dataset is not registered with the server—then copy_data_to_server will always be True.

  • FalseThe data will not be copied to the server. This is the default.
  • TrueThe data will be copied to the server.

(默认值为 False)

Boolean
folder_name

A string that represents a folder name to which you want to publish the service definition. If the folder does not currently exist, it will be created. The default folder is the server root level.

(默认值为 None)

String
summary

A string that represents the Item Description Summary.

Use this parameter to override the user interface summary or to provide a summary if one does not exist.

(默认值为 None)

String
tags

A string that represents the Item Description Tags.

Use this parameter to override the user interface tags or to provide tags if they do not exist.

(默认值为 None)

String

代码实例

CreateImageSDDraft 示例 1

创建影像服务定义草稿文件。

import arcpy
import os
  
mdpath = "C:/workspace/fgdb101final.gdb/md_DEM_las"       
con = "C:/workspace/peony_6080 (publisher).ags"
service = 'lasmd_json'
sddraft = os.path.join(arcpy.env.workspace, service + '.sddraft')

arcpy.CreateImageSDDraft(mdpath, sddraft, service, 'ARCGIS_SERVER', 
                         con, True, None, "Publish las MD", 
                         "las,image service")

相关主题

9/15/2013