I have put together a python script which creates vector tile packages and publishes them to our portal. Everything appears to work fine when zoomed out past about 1:282, but upon zooming further in the data does not display at all. The application in which these packages are used requires that they be visible when zoomed far in.
I have tried to create the vtpk interactively through the ArcGIS pro UI, and it works!! - with a minimum cache scale of 1:295,828,764 and a maximum cache scale of 1:35.27, but I need it to work through the python code because we need this updated nightly and it cannot be a manual process.
this is the CreateVectorTilePackage method call from the script:
arcpy.management.CreateVectorTilePackage(map,outputPath+map.name+".vtpk" , "ONLINE", "", "INDEXED",1000000, 35.27,TileIndex,"Vector Package for application ","Vector Package for application")
If anyone has encountered similar problems or has any advice it would be appreciated!
I would hazard a guess that maybe that scale's not being generated? You might extract the packages and compare their contents.
I doubt there's a difference, but you might also export the result of running the 'Create Vector Tile Package' tool from the UI as a script to see if there's anything there. To me it seems like that level's not being generated though.
-Earl
Earl, Thank you for replying.
you are correct, the problem has to do with tiles not being generated at zoomed scales, upon inspecting the details of each item in portal this is what I found: the left is the vtpk generated from the UI, it builds tiles all the way down to 1:35.27. The right is the vtpk generated from the script, which does not generate tiles past 1:564. So now my question is: what can I do to get the vtpk to build correctly through the python script? (can I use EXISTING, instead of ONLINE?, if so how?). Again any input is appreciated.
Thank you.
Okay, guess that theory panned out. Well, you can try your luck at running the Generate Tile Cache Tiling Scheme—Data Management toolbox | ArcGIS Desktop tool and then use the EXISTING options for service_type and tiling_scheme instead (pointing to the xml you generate). Hopefully, that produces the desired result - I'm not aware of a problem with that function so it'll be interesting to see what you find.
-Earl
Okay, So I have tried running the script many times now pointing to the .xml tile schemes output by the tool, and it is not working as intended. I am not ruling out the possibility that I am not configuring the Generate Tile Caching Scheme tool properly, but I have tried using many different parameters and I am still experiencing the same issue. (in certain configurations the tiles do not appear at any scales) I noticed that in the create vector tile package tool documentation that when the service type is set to existing, that the parameter can be either an xml tile cache scheme, or an existing vector tile service. So I used the URL pointing to the vector tile service that was created through the UI (the one that zooms to all levels) as a parameter to build the vtpks in the script. When I ran the script, it did begin to build the vector tile package but then failed with the error :ERROR 000622 cannot set input into parameter max cached scale. I am going to keep trying with the generate tile cache tool, but I will admit that at this point I am at a bit of a loss. I am confused as to why the UI output works fine, but the python method fails to build all scales even when they have the same input parameters. Is there a chance that this is a bug??
As always any information is appreciated
Thank you.
-.Jeff