Geoserver slice data local cache and hierarchical configuration

In many business scenarios, we will use the layer slicing function. By default, each call is a new re-slicing, which has certain performance problems; based on this, we can perform local cache slicing, and this geographic location only A slicing process is performed, and the data is cached on the local disk, so that the cache slicing process will not be performed until the client accesses the location; to improve the client's access speed, how to configure the cache slicing? Let's start sharing:

1. Local cache slice

1. View the default cache address

After logging in click on the default cache menu:

Enter:

Click the Go to... button

 At the bottom is the default cache address, which is unreliable, hard to find, and not conducive to data organization; let’s start configuring the local custom cache address.

2. Configure the local address

Modify the location of the default slice cache, open the web.xml file in geoserver\WEB-INF under the startup path of geoserver in tomcat

Add cache path configuration

    <!--配置切片存放路径 -->
    <context-param>
      <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
      <param-value>D:\project\geoserver\apache-tomcat-7.0.72\webapps\geoserver\data\gwc</param-value>
    </context-param>

After adding, restart the tomcat of geoserver

3. Verify after startup

After logging in, click Caching Defaults --->Go to...

It shows that the configuration is successful, click on the slice layer to enter this directory:

 The cache tile data does go here.

Note: If it is not preset, it will be stored in the tmp directory of the system by default (C:\Users\<username>\AppData\Local\Temp under Windows, /tmp under Linux); if the C drive is large enough, it is Bad for management.

2. Slicing level configuration

The principle of layer configuration is how many layers can be sliced ​​into layers. The larger the level, the longer it will take, and the number of front-end requests will be more. However, each request responds quickly. Generally, the time for vector slices is relatively short, because the original data is relatively small. ; How many levels to set depends on specific business scenarios.

1. Click the slice layer

 to slice list

2. Click the Seed/Truncate  button

 Configuration instructions:

1) Number of tasks to use: This option indicates how many tasks can be used to cut the picture, similar to the multi-threaded mode, if the computer performance allows, you can increase this number appropriately, so that the speed of slicing will be faster; If the computer performance is not high, if the value is too large, it may affect the performance.

2) Type of operation: Operation type, including: Reseed-regenerate all tiles (re-perform complete slice operation), Seed-generate missing tiles (only slice the missing part), Truncate-remove tiles (clear slice data).

3) Grid Set: Select the Gridset of the slice, which is related to the Gridset set during layer configuration.

4) Format: the data format of the slice. Such as image/png.

Here is related to layer formatting:

 5) Zoom start: The start level of the slice.

6) Zoom stop: the end level of the slice, combined with the option of Zoom start, all the level data between the two levels of data can be sliced.

7) Modifiable Parameters: Modify parameters, select styles for slices, etc.

This is related to the style of the layer setting: layer publishing menu

 8) Bounding box: The boundary range of the slice is optional.

9) Tile failure retries: Number of failed retries.

10) Pause before retry (ms): Pause (milliseconds) setting before retrying.

11) Total failures before aborting: The total number of failures before aborting is set.

3. Submit

After the setting is complete, click Submit 

Start slicing, and you can click Refresh later to see if the slicing is over.

It proves that the slicing is over. At this time, you can go to the slicing address in the local cache to see if there is any data.

At this point, the local cache and hierarchical configuration of geoserver slice data have been shared. We will explain the implementation process of geoserver source code later. In the next part, we will share the use of Qgis, so stay tuned!

Supongo que te gusta

Origin blog.csdn.net/nandao158/article/details/130750875
Recomendado
Clasificación