# 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)
使用GP。tool 创建地图切片示例 参数说明
最新推荐文章于 2023-05-29 11:52:48 发布