Publishing and using ArcGIS Server services--slicing services (TileServer cache services) (1)

Publish and use ArcGIS Server service --- slice service (TileServer cache service)

In this article, I will introduce how ArcGIS Server publishes maps in a cached manner, and briefly introduce the difference between dynamic map services and tiled map services (cached map services); for cache services (TileServer), I will start from two articles Sort out; I hope it will be helpful to everyone's work and study!

The first article is this article, I will introduce the definition of cache service, the introduction of parameters and how to publish; the
second article will sort out from the perspective of cache management and migration, which is also the work to be done next;

The common ones are:
map service: publish and use ArcGIS Server service - map service (Mapserver)
feature service: publish and use ArcGIS Server service - feature server (feature server)
image service: publish and use ArcGIS Server service - image Service (image server)
OGC service: publish and use ArcGIS Server service – OGC service (WMS/WMTS/WFS/WCS/WPS)
cache service: publish and use ArcGIS Server service – cache service (TileServer) (1)
cache service : Manage and migrate ArcGIS Server services and cache services (TileServer) (2)
Geoprocessing services, vector tile services, scene services
, geographic data services, and geometry services, KML services, geocoding services, locator Maritime Server, path services, Schematics service, flow service, utility network service, Workflow Manager service, etc.;

1. What is cache service?

1.1 What is a map service cache?

1.1.1 Map cache and image service cache

1.1.1.1 What is map service cache?

Map caching is a way to make map and image serving run faster. When creating a map cache, the server draws the map at several scale levels and stores a copy of the map image. The server can then distribute these images when someone requests to use the map. It is much faster for the server to return the cached image than to draw the map each time it is requested to use the map. Another benefit of caching is that the level of detail in an image does not significantly affect how quickly the server distributes copies.
insert image description here

1.1.1.2 What is Image Service Caching?

Image service caching improves the performance of image services in client applications. When caching an image service, the server pre-generates tiles at different levels, in which case fetching them is faster than processing the input data for a mosaic dataset or raster dataset each time a request is made from ArcGIS Server faster. An important aspect of image service caching is that it does not serve imagery that is processed on the fly, but instead preprocesses the imagery to create cache tiles and then serves those cache tiles.

When caching an image service, you end up with a dual-purpose image service that can be accessed according to its purpose. One use is to provide the fastest access to imagery as a tile service. Another use is to provide access to data for querying, downloading, accessing individual items, and use in processing and analysis.

NOTE:
All image buffers are stored as 8-bit data.
Regarding the bit depth of raster data, refer to: How does arcgis convert 16bit raster data to 8bit raster data

Of course, we can also convert the map service cache into an image service cache :
the cache generated for the map service can be used for the image service, and vice versa. To do this, there are two basic requirements:

  • The map document and the mosaic dataset or raster dataset should have the same projection and extent.
  • Tiling schemes must be similar. For example, the slices to be copied must be the same, but other slices can be different.

Note: Our common impact caching service is: elevation image caching service ;

1.1.2 Can I cache all maps?

After knowing the map cache, you may ask what are the applicable conditions and scope of the cache service?

Caching is useful for basemaps and maps that change infrequently. For maps that change occasionally, tools are available to update the cache.

A map cache represents a snapshot of the map at a certain point in time. Because of this, caching is ideal for maps that don't change very often. These maps include street maps, imagery maps, and topographic maps.
If the data changes frequently, you can still use caching tools to periodically update the cache. You can set updates to happen automatically.

Knowing whether a map that changes frequently can still be cached requires asking the following questions:

1.1.2.1 How up-to-date do my maps need to be?

If the data you see needs to be real-time, without any time delays, caching the map is not an option. However, caching can still be used if a short delay is acceptable and cache updates can occur within this time window.

1.1.2.2 How big is the cache, and how widely does the data change?

These two problems can be grouped together. Creating large caches tends to take more time. Updating large caches is only practical if the changed areas can be isolated and updated individually. If the cache is small, the entire cache can be rebuilt quickly.

If updates cannot catch up with the pace of changes within an acceptable period of time, it is not appropriate to cache the map.

With the above issues in mind, caching can be used when appropriate. The performance benefits you get are likely to outweigh the cost of creating and updating the cache and are therefore well worth it.

Summary:
From the above description, we can see that the essence of the map cache service is to slice it proportionally at a certain time point in the time series, and then publish it as a map snapshot of the cache service; The image of the data is placed under the first scale level, and the geometric and attribute information of its vector data cannot be accessed, so it is derived: vector tile service ;
about updating the cache, it needs to be determined according to the changing characteristics of its own data;

1.1.3 Can I still access the underlying data?

Although map caches represent pictures of data , you can allow others to identify, search, and query on your map service . These tools get the geographic location of features from a server and return the corresponding results.
The application draws these results in its native graphics layer format on top of the cached image.

That is to say, when we use ArcGIS API for JavaScripts to use TileLyer to call the cache service for query, search, identification and other functions; it is to draw these results on the map snapshot display;

Of course, it's not just ArcGIS API for JavaScripts that can use caching services; the REST API can be called by any language that can call Web services (such as Python, Java, JavaScript, PowerShell, C#, Ruby, Scala, Perl, and others).

1.1.4 How to start caching?

To begin caching, a map or image service must first be published .
insert image description here

The Cache tab appears in ArcMap's Catalog window when publishing a service or displaying service properties :
During the publishing process, you need to set properties on the service editor dialog . Here you define the scale and extent of the cache.

On the Cache tab on the Service Editor dialog , you can specify that the service should use the cache, thereby configuring required settings such as the service's tiling scheme. On the Advanced Settings subtab, you can also select additional options such as image format and whether to configure on-demand caching. Next, let's take a look;

1.2 Data source of cache service

Cache service is a kind of map service (mapserver), and its data source is also a data source supported by mapserver:
specific reference: Publishing and using ArcGIS Server service - 1.1 Map service data source and support method of map service (Mapserver)

1.3 What is the difference between vector slices and raster slices?

1.3.1 Slice layer

When doing your own applications, it is often necessary to provide various basemaps of real-time geographic environments for operational layers. So why are basemaps stored as tile layers, designed to be easily and quickly accessible from web maps, web apps, and virtually any mapping software application.

For example, include a basemap with street tiles in your neighborhood to provide a graphical reference for the street symbols in your feature layer. Tile layers are also needed when exporting maps or layers on the web for visualizing relatively static data.

Tile layers have different formats depending on the original source data . Tile layers can be stored as prerendered raster tiles or vector tiles . Raster and vector tiles are designed to provide high-performance and highly scalable map data for visualization.

1.3.2 Vector Tile Layer (Vector Tile Service)

Vector tiles are a compact binary format that utilizes Protocol Buffers technology to convey information. Vector tiles use a set of stored internal data for cartography when rendering a map. Layers organized into vector tiles such as (water, roads, areas, etc.), each with individual features containing geometry and variable attributes. In layman's terms, it is to divide the vector data into descriptive files like raster slices in the way of building pyramids, organize them in custom formats such as GeoJson format or PDF, and then request different vectors according to the display needs on the front end Tile data for web drawing

A vector tile service is an ArcGIS Server web service from the vector tile package in ArcGIS Pro. Vector tile services (also known as vector tile layers) enable you to share and use vector tiles in ArcGIS Enterprise organization and custom applications.

A vector tile layer references a set of web-available vector tiles and the corresponding styles in which those tiles should be drawn. Vector tiles are similar to raster tiles, but they store a vector representation of the data. That is, geographic features are represented as points, lines, and polygons in a format that client applications understand. Unlike raster tile layers, vector tile layers adapt to the resolution of the display device and can be styled for a variety of purposes. Vector tile files are smaller than raster tile files, which means faster drawing and better performance.

In Map Viewer, you can customize the style of the vector tile layer and the content of the map. Additional advantages of vector tile layers are as follows:

You can generate many different map styles using a set of vector tiles. For example, you can change the symbol, font, or language labeled on a vector tile layer without having to regenerate the tiles.
Vector tile layers display better than raster tiles on high-resolution displays, such as Retina devices. In desktop applications such as ArcGIS Pro, vector tiles can be displayed at any scale level while keeping symbology and labels clearly visible.
Vector tiles are much smaller in size than the corresponding raster tiles. Therefore, it takes less time to build and requires less disk space for storage.
Desktop applications such as ArcGIS Pro can project vector tile layers into various coordinate systems without distorting labels and other symbols.

1.3.3 Raster tile layer

Raster tile layers deliver basemaps to client applications as image files (for example, in JPG or PNG format), which are prerendered and stored on the server, and displayed as-is by the client. Raster tile layers are best suited for basemaps that provide geographic context for your map, such as imagery (such as in the World Imagery basemap) or feature-based maps such as terrain, national geographic, oceanographic, and other basemaps. Raster tile layers can also be composed of static operational layers, such as a thematic map of your data.

The tile layer format transfers quickly over the Internet and is easily understood by most common mapping software applications, so these basemaps are compatible not only with ArcGIS and web applications built using the ArcGIS API, but also with OGC protocols such as WMS/WMTS) are compatible with third-party applications.

1.4 Simple understanding of (slicing/tile/caching) and dynamics

What is the difference between dynamic and cached?

Map slicing : the process of storing on the server side in a pre-generated method, and then sending the corresponding map tiles to the client according to different requests submitted by users. It is a multi-resolution hierarchical model, from the bottom layer of the tile pyramid to the top layer , with lower and lower resolutions, but the same geographic extent represented.

Map cache : also known as map tiles, is a directory containing map slices of the entire map range at different scales, that is, a cached map service is a service that can quickly provide maps using static images.

The map service (mapserver) we usually publish, when displayed on the front end, is dynamically drawn in real time as the hand scale is zoomed in and out; and the map service (mapserver) is also a dynamic map service;
insert image description here

Then the cache service (TileServer) is a service that caches the service on the server in advance, and then calls it at the front end; it is also called a slice service; many of our common tile services are essentially is a cache service;

1.5 What are the advantages and disadvantages of caching services?

1.5.1 Advantages of Sliced ​​Map Service

Since the pictures in the tiled map service do not need to be generated by the server in real time, they are stored on the hard disk of the server, so the performance of the server is greatly improved.

The level of detail in the image does not significantly affect how quickly the server distributes copies.

1.5.2 Disadvantages of Sliced ​​Map Service

Because the image of the tiled map service exists in advance, the function of this service is limited. For example, if you want to hide a certain layer in the service, it cannot be realized.

When the cache level is high, the amount of hard disk storage occupied is large;

2. A brief introduction to the relevant parameters of the cache service

2.1 What is a tiling scheme?

The tiling scheme includes the cached scale level, tile dimensions, and tile origin . These properties define where cache boundaries exist and are important for matching operations when overlaying caches in some clients.

There are several options to choose from for a tiling scheme:
insert image description here

insert image description here

2.1.1 ArcGIS Online/Bing Maps/Google Maps

Selecting ArcGIS Online/Bing Maps/Google Maps allows you to overlay tiles from these online map services on top of the cached tiles. ArcGIS dynamically projects the source map into the coordinate system required by this tiling scheme, which is WGS 1984 Web Mercator (Auxiliary Sphere). If you want to enhance performance when creating tiles, you can project your data and data frame into this coordinate system before publishing the service.

If you are overlaying the cache with maps from ArcGIS Online, Bing Maps, or Google Maps, you need to use the ArcGIS Online/Bing Maps/Google Maps tiling scheme. ArcGIS Online overlays are available in virtually all recent Esri client applications. Bing Maps overlays are available in Map Viewer and many ArcGIS web viewers and APIs. Google Maps overlays are available through the ArcGIS API for JavaScript extension to the Google Maps API.

The advantage of the ArcGIS Online/Bing Maps/Google Maps map tiling scheme is that it is well known in the web map community, so your tiles will be consistent with those of other organizations using this tiling scheme. Even if you don't plan to overlay these well-known map services, you can still choose this tiling scheme for interoperability.

ArcGIS Online/Bing Maps/Google Maps tiling schemes may contain scales that are too magnified to be usable in the map. Caching at large scales is time-consuming and consumes a lot of disk storage space. For example, the maximum ratio in a tiling scheme is about 1:1,000. Caching the entire continental United States at this scale would take weeks and require hundreds of gigabytes of storage. If it is not ready to be cached at this scale level, it can be removed in the level of detail range.

Warning:
It is better to choose not to create tiles at this scale than to delete the scale in the tiling scheme. If you remove the scale from the ArcGIS Online/Bing Maps/Google Maps map tiling scheme, you may not be able to overlay the tiles for that service.

2.1.2 Tiling scheme file

If you cannot use the scale or coordinate system in the ArcGIS Online/Bing Maps/Google Maps tiling scheme, you can create your own tiling scheme. Use the Generate Map Server Cache Tiling Scheme tool in the Server Toolbox to generate an XML tiling scheme file. There are several settings that this tool dialog box requires you to provide later in this topic. Whenever you create a cache, you can browse to this tiling scheme file to import all your preferred scales and settings.

Older versions:
At version 10.0 and earlier, ArcGIS Online used a tiling scheme based on the WGS 1984 geographic coordinate system using 512 x 512 pixel tiles. If a running service requires this tiling scheme, it must be loaded from an existing service or tiling scheme file.

2.1.3 Existing cached map/image services

Select this option if you want to match an existing caching service tiling scheme. You will be prompted to browse to the service.

A matching tiling scheme ensures that tiles stack up correctly in web applications and other hybrid web applications.

If this option is selected, the source map document and the map used to import the tiling scheme should use the same coordinate system.

2.1.4 Recommendations

When you select this option, you will be prompted for the desired scale progression and will recommend a specific scale value. Suggested scales start at 1:1,000,000, in increments or decrements of powers of 2, and start with the level closest to the extent of the source map document.

For example, if the source map document has a range of 1:121,000,000 and defines three scale levels, the system recommends the following scale values:

1:128,000,000
1:64,000,000
1:32,000,000
In general, you should limit the number of proposed scales requested to 20 or fewer. If the full extent of the map covers a relatively small area, such as a city, it may not be possible to obtain the requested number of scales. More scales can be added manually using the Advanced Settings tab.

Once you're familiar with the cache creation process, it's better to choose a custom scale level than to ask the software to suggest a scale for you. If possible, you should choose a scale before you start designing your map. In this way, the designed map will have a good display effect under various scales.

2.2 Caching method

There are two types of ArcGIS Server caching services: automatically creating a cache when creating a service and manually creating a cache after creating a service.
insert image description here

Tiles can be created immediately when the service is published (good for smaller caches), or you can choose to build the cache yourself after publishing (good for larger caches, in which case you want to geographically constrain building at a large scale the number of caches). When building the cache yourself, the building of the cache is performed using the Manage Map Server Cache Tiles geoprocessing tool available in the Server Tools toolbox.

2.3 Region of interest to be cached

If ArcGIS automatically builds the cache is selected when publishing the service, this setting determines which areas of the map will have tiles created. The options are as follows:
insert image description here

Full Extent of Map - This option caches the entire bounding box of all data in the map. This is the default option. The custom full map set in ArcMap via the data frame properties will be applied.
Current extent of map - This option caches the extent of the currently published map document; that is, the initial extent of the map service.
Import from Feature Class—This option is used to cache only the areas that intersect the boundaries of features in the selected feature class. For example, if you want to limit the creation of tiles to only the areas covering the state of California, browse to a simple feature class containing the boundaries of California.
The Import Feature Class option is recommended when the cache is large or the area of ​​interest is not rectangular. See Feature boundary-based map caching for tips on preparing and selecting feature classes for this.

The AOI you set here applies only to caches that are automatically generated at publish time. This area is always covered by the Area of ​​Interest you set when you manually ran the Manage Map Server Cache Tile tool. If no ROI is explicitly set using the Manage Map Server Cache Tiles tool, the full extent of the map will be cached.

2.4 Cache directory

The ArcGIS Server cache directory can be a hard drive where the cache tiles are stored or a folder in cloud storage.

The server cache directory can be opened to examine the cache tiles and tiling scheme file conf.xml. The cache directory may also contain a status.gdb file geodatabase that contains information about tiles that have been built.

The image below shows a loose-format cache in Windows Explorer, where each tile is stored as a single file.

A compact cache, on the other hand, appears as multiple larger files (called bundles) that store a large number of tiles.

2.5 Slicing format

This setting determines the output image format to be used by the map service when creating tiles. Choosing an image format is important because it will determine the size of the tile on disk, image quality, and the ability to make the tile background transparent.
insert image description here

When initializing a new cache, ArcGIS examines the layers in the map and chooses a default image format for you. If the map contains only vector layers, the default image format is PNG. If at least one raster layer is detected, the default image format is MIXED.

You should examine this default format and determine whether it is adequate for your mapping purposes. The following is a summary of the available image formats and their respective uses:

PNG - For each tile, this format determines the PNG bit depth that will minimize the tile storage space without reducing the display effect. This works well for many vector maps, especially those with fewer colors, more bands of a single color, or overlaid networks. If you're not sure which PNG format to use, try this format first.
PNG8 - PNG 8 is used for overlay services that require a transparent background, such as roads and borders. PNG 8 creates very small tiles on disk without losing any information.
Use PNG or PNG 32 instead of PNG 8 to see higher quality lines and labels when anti-aliasing is used on the map. PNG or PNG 32 may also be required if the map contains a lot of color due to gradient fills or hillshading.

PNG24 - Use PNG 24 for overlay services with more than 256 colors (or PNG 8 if less than 256 colors), such as roads and borders. Do not use PNG 24 if the tile will be viewed in Internet Explorer 6 or earlier.
PNG32 - PNG 32 is used for overlay services such as roads and borders in more than 256 colors. PNG 32 is especially useful for overlay services that have anti-aliasing enabled for lines or text. PNG 32 creates larger slices on disk than PNG 24, but is fully supported by all browsers.
JPEG—This format is used for basemap services that have large color variations and do not require a transparent background. For example, raster images and highly detailed vector basemaps are particularly good candidates for JPEG.
JPEG is a lossy image format. It attempts to selectively delete data without affecting how the image appears. This produces very small tiles on disk, but if the map contains vector linework or labels, it may produce excessive noise or blurry areas around the lines. If this happens, try increasing the compression value from the default of 75 to a higher value. Higher values ​​(such as 90) produce acceptable linework quality while maintaining small slices in JPEG format.

You can determine acceptable image quality. If you are willing to accept a small amount of noise in your images, choosing JPEG can save a lot of disk space. Smaller tiles also mean that the browser can download tiles faster.

MIXED - A mixed cache uses JPEG at the center of the cache and PNG 32 at the edges of the cache. If you want to completely overlay your raster cache on top of other layers, you should use a blending mode.
When creating a blend cache, PNG 32 tiles are created wherever transparency is detected (that is, where the background of the data frame is visible). The remaining slices are constructed using JPEG. This reduces the average file size while allowing full stacking on other caches. If you do not use a blend mode cache in this case, you will see opaque raised edges around the perimeter of the image overlaying other caches.

LERC - Limited Error Raster Compression (LERC) is an efficient lossy compression method recommended for single-band or elevation data with large pixel depths (such as float, 32-bit, 16-bit, or 12-bit data). For floating point data, LERC compresses 5 to 10 times better and 5 to 10 times faster than LZ77. For integer data, LERC also outperforms LZ77. LERC is considered lossless compression when using integer data and specifying an error limit of 0.99 or lower.
Note:
LERC is only available for image services; map services are not supported.

Elevation data or surfaces are widely used in 3D views, such as terrain models, to represent the ground. You can use surfaces that do not represent the ground, such as an ozone layer above the earth's surface or a geological base below the earth's surface. If the LERC compression method is used to process surfaces that are not at ground level, it is strongly recommended to publish the data with all levels of detail. This will ensure that the data is not zoomed out below the coarsest resolution when viewing the data, otherwise rendering of the content will stop. However, this is not important for the elevation content of the participating surface, since the surface can be used to fill in any gaps that may exist.

If LERC is selected, use the Compression dialog to specify the compression value. Compression represents the maximum tolerance error value applied to each pixel (not the average of the image). The value is specified in the units of the mosaic dataset. For example, if the error is 10 centimeters and the units of the mosaic dataset are meters, enter 0.1.
If the source data is not supported at a particular scale, or if an overview does not exist, LERC-based caching services will not perform resampling for drawing purposes. Additionally, LERC-based caching services will contain a properties file that lists whether the service contains elevation data. LERC-based caches should use a cache tile size half a pixel larger than the standard 256 x 256 when drawing the full extent of a 3D scene.
The LERC format uses a non-transform compression algorithm, and the compression value or maximum error allowed value will vary from 0 to 1,000.
Tip:
The most common situation where you might need to change the default image format is when building vector-only basemaps that use antialiasing. In this case, the higher-compression-quality JPEG or MIXED formats are more suitable than the default PNG, because the resulting tiles are much smaller on disk.

Before deciding on an image format for a large cache, build a smaller cache for a representative map area and check tile quality and performance in a test application. If you are using multiple caches, build a test cache of each cache and add them to your test application to ensure they stack up as expected. This gives you the opportunity to make adjustments before creating the entire cache.

To create a small test cache, first use the editing tools in ArcMap to create a feature class containing a small rectangle around the area to be tested. Then use the options at the bottom of the Manage Map Server Cache Tiling tools dialog box to create tiles based on the boundaries of the feature class. Browse to the feature class containing the test area and create tiles.

2.6 Other advanced settings

This section describes some advanced cache settings, available from the Advanced button in the Service Editor's Cache > Advanced Settings sub-tab. These properties (Tile Origin, Dots Per Inch, Tile Width, and Tile Height) can only be set when generating a new tiling scheme using the Generate Map Server Cache Tiling Scheme tool.
insert image description here

2.6.1 Slice origin (map unit)

The tiling scheme origin is the upper left corner of the tiling scheme grid. The origin does not necessarily represent the starting point for creating tiles; this is only true when reaching the full extent of the map or area of ​​interest feature class. Using a common tiling scheme origin when caching ensures that they will overlay each other in the web application.
insert image description hereIllustration of tiling scheme origin and tiling scheme grid

In most cases, the software's default tiling scheme origin should be maintained. The default origin is the upper left point of the coordinate reference defined by the map document. If no coordinate reference is defined in the map document, ArcGIS will determine the origin of the tiling scheme by computing the union of all layers in the cache and doubling the extent. The top-left coordinate of the result will be the origin of the tiling scheme.

If you change the tiling scheme origin to a location other than the default, you should be aware that tiles can only be created in the area of ​​the map below and to the right of the tiling scheme origin. If you only want to cache a certain area of ​​the map, creating tiles based on feature class boundaries is a better option than changing the tiling scheme origin.

Dots per inch (DPI)
Dots per inch (DPI) refers to the resolution of the cache tiles that the server will generate. The default of 96 is usually adequate unless you are working on a network where most client computers have different DPIs. Note that adjusting the DPI will affect the scale of the tiles.

2.6.2 Slice height and slice width

The default width and height of tiles is 256 pixels. 256 or 512 is recommended. If you are building a cache that will overlap another cache, make sure to use the same tile width and height for both caches.

Choosing smaller tile widths and heights can improve the performance of applications requesting tiles from the cache because less data needs to be transferred. But for loose caches, the smaller the tiles, the larger the cache and the longer it takes to create.

2.6.3 Storage format of cache service

insert image description here

Optionally group tiles for greater storage efficiency and mobility, or store each tile as a single file. The storage options are as follows:

Compact - In compact format, each file in the cache contains a pack of tiles. Each pack is 128 slices wide by 128 slices high and contains a maximum of 16,384 slices. A compact cache replicates much faster than a loose cache and uses less disk space.

Loose - In the Loose format, each tile is stored as a file on disk. This is convenient for viewing tiles in the cache; however, it makes the resulting cache larger, takes more time to create, and is not easily replicated.

Sometimes, the large number of files and folders in the cache can make copying tools, including Windows copy and paste, ineffective. Therefore, a compact cache can greatly reduce cache copy times. A compact cache is recommended for automatic cache update workflows where tiles are created on the staging server and then copied to the production server. Also, compact cache should be used if available disk space is limited.

2.6.4 Allow the client to cache tiles locally

Checking this box will allow Esri client applications such as ArcMap to keep a local cache of any tiles retrieved from the server. This helps clients view tiles more quickly when returning to the region. Clients must manually clear their caches to obtain newer tiles from the server; therefore, if you are updating your cache frequently, you should consider unchecking this box.

2.6.5 Allow clients to export cache tiles

The ArcGIS client API allows applications to download map tiles from a server for offline use. These downloads are authorized when you select the Allow clients to export cached tiles checkbox.

Large tile downloads can negatively impact server performance and overload client devices. Use the Limit export cache to setting to define the maximum number of tiles the client can request at one time.

Tip:
If you're trying to determine the maximum number of tiles to allow for download, looking at the total number of tiles in the cache can provide useful information. This information is available from the detailed report on the cache completion status. See Viewing cache completion status.

Exported tiles are placed in the server output directory. When allowing clients to export tiles, you may want to increase the maximum age of files allowed in the server's output directory. The default retention period of 10 minutes may not be long enough for clients to complete retrievals before tiles are cleaned up.

The principle of caching service introduced above, let’s introduce how to publish caching service operation examples in arcmap and arcgis Pro;

3. Publish cache service

Arcmap publishes a cache service operation example:

Then we will use our own data below, and then create a slicing scheme that meets our own needs, and then because it is slow to slice the data directly when republishing; we will slice after the publishing is completed (of course, all slicing can also be done level by level. Slicing), so that we can check our cache service more intuitively;
insert image description here
after publishing, we can check it in the rest interface:

insert image description here
You can see the level of our slice:
insert image description here

4. ArcGIS API for JavaScript calls cache service (TileServer)

TileLayer is used to load the cache service;

The cache service directly obtains slices from the cache without dynamic rendering;

require(["esri/layers/TileLayer"], function(TileLayer) {
    
    
  var layer = new TileLayer({
    
    
    url: "https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer"
  });
  // Add layer to map
});

Guess you like

Origin blog.csdn.net/weixin_40625478/article/details/108662381
Recommended