Select to view content in your preferred language

Issue Creating Vector Tile Package

651
0
02-10-2021 06:59 AM
MichaelLorenz
New Contributor

Hello Everyone,

 

i am trying to create a vector tile package from a python script.I am using ArcGIS pro v2.7.i am always getting the same error 

Error: ArcGIS Fehler: ERROR 002112: The root tile must overlap the data sufficiently for features to draw.
Failed to execute (CreateVectorTilePackage).

i am creating tile cache schema and passing that to create tile index and then create tile package.

one thing I found is in Arcgis pro when I try to create vtpk the schema XML is created automatically and it different from what I create with a toolbox and also from what I create from python.

the origin is different and it selects different scales and in Arcgis Pro it works but not in python.

for origin, i am taking map extent and then upper left point

mapExtents = input_map.defaultCamera.getExtent()
origin = "{0} {1}".format(mapExtents.upperLeft.X, mapExtents.upperLeft.Y)
 

i also tried to get the extent of feature class but still the has the same issue.i could not use ONLINE option because map coordinate system is not WGS84

all code snippet is as follows

APRX = arcpy.mp.ArcGISProject(APRXLocation)
input_map = APRX.listMaps(mapName)[0]
mapExtents = input_map.defaultCamera.getExtent()
origin = "{0} {1}".format(mapExtents.upperLeft.X, mapExtents.upperLeft.Y)
with arcpy.EnvManager(scratchWorkspace=ws, workspace=ws):
        arcpy.management.GenerateTileCacheTilingScheme(in_dataset=input_map, out_tiling_scheme=TPKSchemeName, tiling_scheme_generation_method="NEW", number_of_scales=TPKScalesNum, predefined_tiling_scheme=None,scales=TPKScales, scales_type="SCALE", tile_origin=origin, dpi=96, tile_size="512 x 512", tile_format="PNG", tile_compression_quality=0, storage_format="COMPACT", lerc_error=None)

indexFC = "in_memory\\vector_tile_index"

arcpy.management.CreateVectorTileIndex(input_map, indexFC, "EXISTING", TPKSchemeName, 10000)

arcpy.management.CreateVectorTilePackage(input_map, tpkFile, "EXISTING", TPKSchemeName, "INDEXED", "", "", None, '', '')

 

also attaching the XML Script created by python script and xml created by ArcGIS Pro

 Thanks in Advance

Tags (2)
0 Kudos
0 Replies