• 大小: 3KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: Python
  • 标签: Python  

资源简介

Python2.7自动发布arcgis的mxd服务

资源截图

代码片段和文件信息

#自动发布地图服务

#第一步:创建server的连接文件.ags
import arcpy #调用arcpy方法
‘‘‘out_folder_path=‘F:\mxd‘
out_name=‘test.ags‘
server_url=‘http://192.168.1.241:6080/arcgis/services‘
arcpy.mapping.CreateGISServerConnectionFile(“USE_GIS_SERVICES“
                                            out_folder_path
                                            out_name
                                            server_url
                                            “ARCGIS_SERVER“
                                            username=‘admin‘
                                            password=‘2Gsafety!@123456‘
                                            save_username_password=True)‘‘‘

outdir = ‘F:\mxd‘
out_folder_path = outdir
out_name = ‘test.ags‘
server_url = ‘http://192.168.1.241:6080/arcgis/admin‘
use_arcgis_desktop_staging_folder = False
staging_folder_path = outdir
username = ‘admin‘
password = ‘2Gsafety!@123456‘
    
arcpy.mapping.CreateGISServerConnectionFile(“ADMINISTER_GIS_SERVICES“
                                            out_folder_path
                                            out_name
                                            server_url
                                            “ARCGIS_SERVER“
                                            use_arcgis_desktop_staging_folder
                                            staging

评论

共有 条评论