使用GP。tool 创建地图切片示例 参数说明

# Script Name: CreateFused Map Server Cache
# Description: Creates a fused map server cache tiling scheme using PNG8 image format
# Uncomment sys.argv[] lines to accept arguments from the command line.
# Import standard library modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Set the path to the cache.
# Example: \\\\myServer\\arcgiscache\\MyServiceFolder_MyService\\
out_folder = "\\\\myServer\\arcgiscache\\MyServiceFolder_MyService\\"
#out_folder = sys.argv[1]
# Set the SOM server name
# Example: "mySOM"
server_name = "mySOM"
#server_name = sys.argv[2]
# Set the object_name
# Example: "MyServiceFolder/MyService"
object_name = "MyServiceFolder/MyService"
#object_name = sys.argv[3]
# Set the data frame
# Example: "Layers"
data_frame = "Layers"
#data_frame = sys.argv[4]
# Set the map cache tiling origin
# Example: "-180 90"
tile_origin = "-180 90"
#tile_origin = sys.argv[5]
# Set the scale levels for the cache.
# Example: "2000000;500000;250000"
scales = "2000000;500000;250000"
#scales = sys.argv[6]
# Set the layers to cache.
# Example: "My First Layer;My Second Layer;My Third Layer"
layers = "My First Layer;My Second Layer;My Third Layer"
#layers = sys.argv[7]
# Set cache tile image format.
# Example: "PNG8"
cache_format = "PNG8"
#layers = sys.argv[8]
# Non-argument variable declarations
tiling_scheme_type = "NEW"
tiling_schema = ""
scales_type = "STANDARD"
num_of_scales = "3"
dpi = "96"
tile_width = "512"
tile_height = "512"
map_or_layers = "FUSED"
antialiasing = "ANTIALIASING"
tile_compression_quality = "0"

try:
    print 'Starting Cache Generation'
    gp.CreateMapServerCache(server_name, object_name, data_frame, out_folder, tiling_scheme_type,  scales_type, num_of_scales, dpi, tile_width, tile_height, map_or_layers, tiling_schema, tile_origin, scales, layers, antialiasing, cache_format, tile_compression_quality)
    print 'Finished Cache Generation'
except:
    gp.AddMessage(gp.GetMessages(2))
    print gp.GetMessages(2)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值