AnsweredAssumed Answered

Vector Tile package creation

Question asked by mageshwaran57 on Aug 29, 2018
Latest reply on Aug 29, 2018 by mageshwaran57

While creating Vector Tile package creation using the selected layer extent, the output vtpk does not have the selected extent.Please review my code and correct it.

 


               project=arcpy.mp.ArcGISProject(r"e:\projects\waldo\CREATE_VTPK_PACKAGE.aprx")
               map = project.listMaps("LANDBASE")[0]
               layer = map.listLayers("PLAT GRID")[0]
               arcpy.analysis.Select(layer, r"E:\Projects\Waldo\CREATE_VTPK_PACKAGE.gdb\WC_ID_1555", "WC_ID =1555")               
               lyt = project.listLayouts("LBELayer_WALDO")[0]
               mf = lyt.listElements('MAPFRAME_ELEMENT',"Layers Map Frame")[0]
               ext = mf.camera.getExtent()
               mf.map.addDataFromPath(r"E:\Projects\Waldo\CREATE_VTPK_PACKAGE.gdb\WC_ID_1555")
               WC_ID = map.listLayers()[0]
               mf.camera.setExtent(mf.getLayerExtent(WC_ID,True,True))               
               ext = mf.camera.getExtent()
               map.defaultCamera.setExtent(mf.getLayerExtent(WC_ID,True,True))                    
               layers= map.listLayers()
               for l in layers:                    
                       if l.name=="WC_ID_1555":
                            map.removeLayer(l)
               project.save()
               arcpy.management.CreateVectorTileIndex(map, r"E:\Projects\Waldo\CREATE_VTPK_PACKAGE.gdb\IDX_1555", "EXISTING", r"C:\Users\AppData\Local\ESRI\Geoprocessing\VTTS_4326_GCS_WGS_1984.xml", 10000)
               arcpy.management.CreateVectorTilePackage(map, "E://Projects//Waldo//MobileMapPackages//VTPK_FILES//1_1555"+'.vtpk', "EXISTING",Tiling_Schema, "INDEXED", 295829355.454566, 0, r"E:\Projects\Waldo\CREATE_VTPK_PACKAGE.gdb\IDX_1555")
               
               project.save()

Outcomes