Hi Malik,
Very likely what you are/were encountering is expected behavior. Please allow me to explain how the AOI functionality works.
Two things often cause a bit of confusion on the Area of Interest feature:
- Scales are generated which exceed the extent of the Area of Interest - this results in the creation of low-resolution super tiles at smaller scales (smaller in GIS terms, e.g. 1:4,622,324). To not see super tiles you would simply create tiles for scales that more accurately capture the full extent of the Area of Interest.
- In general, seeing imagery outside of the Area of Interest is expected: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/common-caching-questions.htm.... As explained in the documentation, "You should not see tiles created outside the boundary of your area of interest beyond 4,096 pixels in any direction." So, at any given scale there may be tiles created outside of the boundary boundary The 'bleed over' is very apparent if you create smaller scales as per #1.
To better visualize the above points, consider NVIDIA's concept of Conservative Rasterization:
From the above, it's easier to imagine that a super tile would be generated if the Area of Interest overlaps with its boundary.
When one provides an AOI for a given scale, the caching tools will try to render an area of 4096x4096 pixel (no antialiasing) or 2048 x 2048 pixels (antialiasing) of the map at the scale provided and store the tiles on disk. If the AOI is smaller than the super tile, then the cache will be generated for the entire super tile regardless.
In the above example, if one tries to generate cache for the State of Louisiana at L00 to L04 using the ArcGIS Online tiling scheme they would still see the entire world as the entire world can be rendered in 4096x4096 pixels at these levels.
To ensure cache tiles are only being generated for the super tiles, one should use the scale within the range of the Area of Interest. For Louisiana, this would constitute level 8 (2311162.217) and above. At these levels, the super tile extents would be smaller than the Area of Interest. You can confirm the cache is generate up to 4096 x 4096 pixels around the state of Louisiana and no cache generated for the state of “Missouri” at Level 10:
Note above that for L10, the shading ends before reaching Missouri.
How about a more in-depth example? Suppose one loads the following feature classes into an MXD:
- Illinois substations (point)
- Illinois transmission lines (polyline)
- Illinois natural gas pipelines (polyline)
- State boundary (polygon).
Everything is projected to EPSG: 3857. Here it is apparent that the State of Illinois is entirely visible at a scale of 1:3,711,017:
Let's suppose this data is published as a Map Service and the below tiling scheme is defined:
The scheme's minimum scale level is 7, or 1:4,622,324 - it was established earlier that the State of Illinois is visible at 1:3,711,017. Therefore, if using an Area of Interest it may not make sense to create scales lower than 1:288,895 or else you will see portions of State of Illinois when zoomed out:
The cache is created and the Cached Map Service is loaded into the MXD. As expected, nothing in the service is visible at 1:609,711:
However, zoom to the scale of the smallest scale that was generated (1:288,895) and you can see features. Here, notice that there are some tiles generated outside of the Area of Interest boundary. Again, this is expected and won't exceed 4096 pixels in any direction:
For even greater confidence that the Area of Interest was honored and only the desired scales were generated, you can view the Status.gdb that is generated with the service's cache. You will typically find this File Geodatabase here: arcgisserver\directories\arcgiscache\<service name>\Layers
Establish a folder connection to the cache directory and view the contents of the File Geodatabase:
The most relevant Feature Classes are JobStatus and TaskStatus. Load one or both of these into the same MXD. From the Feature Class extents, it should be immediately apparent that tiles were only created for the Area of Interest:
Furthermore, review the JobStatus Attribute Table to confirm that only the desired scales were generated:
Hope this helps you and anyone else interested in knowing how the AOI functionality works!
Kind regards,
Earl