constraining ManageMapServerCacheTiles_server by feature class

253
1
03-31-2011 01:48 PM
JonathanCox
New Contributor
Howdy,

  I'm attempting to write a script which updates a tile cache with ManageMapServerCacheTiles_server. In order to speed up the script, I'd like to update only a subset of the tiles, and was hoping to use a feature class in the update_feature_class parameter to make the tool only recreate those tiles which cover that feature. ManageMapServerCacheTiles_server does recreate my tiles, however it insists on always doing every single tile instead of only those which intersect my feature in update_feature_class. On a possibly related note, it seems that setting update_mode="Recreate Empty Tiles" still results in the tool recreating every single tile. I have confirmed that the lyr file I am using only covers a small portion of the total map.

Has anyone gotten the feature class constraint on ManageMapServerCacheTiles_server to work correctly? Can you tell me what I am doing wrong?

--------------------------------------
My code:
InServer="localhost"
InMap="TexPopTest"
InDataFrame="Layers"
RemoveLayers=""                
RedoLevels=""                  
RedoUpdateMode="Recreate All Tiles"              
RedoUpdateFeatureClass="J:\wptc\Shapefiles\Selector2.lyr"

arcpy.ManageMapServerCacheTiles_server(server_name=InServer, object_name=InMap, data_frame=InDataFrame, Layer=RemoveLayers, levels=RedoLevels, update_mode=RedoUpdateMode, update_feature_class=RedoUpdateFeatureClass)


cheers,
jonathan
Tags (2)
0 Kudos
1 Reply
JonathanCox
New Contributor
OK, through trial and error I answered my own question. While ManageMapServerCacheTiles_server will accept a lyr file as input, it will not use it correctly for restricting a tile cache update. I found that using a .shp file (the same one from which I had originally built the lyr file) instead of a lyr worked correctly.
0 Kudos