개발공작소
728x90

 

 

 

 

geoserver에서 wmts레이어는 미리 타일링을 뜨는데, 보통 타일링 결과는 기본적으로

gwc디렉터리에 저장된다. 관련내용은 아래 링크에서 확인하도록 하자.

 

[GIS] 지오서버(GeoServer) 타일링에 대한 이야기 및 타일링 결과 확인하는 방법

 

근데 타일링 결과를 gwc 디렉터리가 아닌 다른 경로에 저장하고 싶다면 어떻게 할까?

 

타일링결과 경로를 설정하는 방법

 

gwc디렉터리에 있는 geowebcache.xml파일을 수정하도록 하자.

 

geowebcacge.xml 수정전

<?xml version="1.0" encoding="utf-8"?>
<gwcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://geowebcache.org/schema/1.17.0 http://geowebcache.org/schema/1.17.0/geowebcache.xsd" xmlns="http://geowebcache.org/schema/1.17.0">
  <version>1.17.0</version>
  <backendTimeout>120</backendTimeout>
  <gridSets><!-- 그리드셋 -->
    <gridSet>
      <name>EPSG:5179</name>
      <description>EPSG:5179</description>
      <srs>
        <number>5179</number>
      </srs>
      <extent>
        <coords>
          <double>531371.8435309182</double>
          <double>958259.7352309179</double>
          <double>1663741.9056021979</double>
          <double>2274021.3084674757</double>
        </coords>
      </extent>
      <alignTopLeft>false</alignTopLeft>
      <resolutions>
        <double>5139.693645455303</double>
        <double>2569.8468227276517</double>
        <double>1284.9234113638258</double>
      </resolutions>
      <metersPerUnit>1.0</metersPerUnit>
      <pixelSize>2.8E-4</pixelSize>
      <scaleNames>
        <string>EPSG:5179:0</string>
        <string>EPSG:5179:1</string>
        <string>EPSG:5179:2</string>
      </scaleNames>
      <tileHeight>256</tileHeight>
      <tileWidth>256</tileWidth>
      <yCoordinateFirst>true</yCoordinateFirst>
    </gridSet>
  </gridSets>
  <layers/>
</gwcConfiguration>

 

 

geowebcache.xml 수정후

<?xml version="1.0" encoding="utf-8"?>
<gwcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://geowebcache.org/schema/1.17.0 http://geowebcache.org/schema/1.17.0/geowebcache.xsd" xmlns="http://geowebcache.org/schema/1.17.0">
  <version>1.17.0</version>
  <backendTimeout>120</backendTimeout>
    <blobStores>
    <FileBlobStore default="true">
      <id>usrmaptile</id>
      <enabled>true</enabled>
      <baseDirectory>사용자가 원하는 경로</baseDirectory><!-- ex: /DATA/tile_result -->
      <fileSystemBlockSize>4096</fileSystemBlockSize>
      <pathGeneratorType>TMS</pathGeneratorType>
    </FileBlobStore>
    <FileBlobStore default="false">
      <id>tms</id>
      <enabled>true</enabled>
      <baseDirectory>사용자가 원하는 경로</baseDirectory><!-- ex: /DATA/tile_result -->      
      <fileSystemBlockSize>4096</fileSystemBlockSize>
      <pathGeneratorType>TMS</pathGeneratorType>
    </FileBlobStore>
  </blobStores>
  <gridSets><!-- 그리드셋 -->
    <gridSet>
      <name>EPSG:5179</name>
      <description>EPSG:5179</description>
      <srs>
        <number>5179</number>
      </srs>
      <extent>
        <coords>
          <double>531371.8435309182</double>
          <double>958259.7352309179</double>
          <double>1663741.9056021979</double>
          <double>2274021.3084674757</double>
        </coords>
      </extent>
      <alignTopLeft>false</alignTopLeft>
      <resolutions>
        <double>5139.693645455303</double>
        <double>2569.8468227276517</double>
        <double>1284.9234113638258</double>
      </resolutions>
      <metersPerUnit>1.0</metersPerUnit>
      <pixelSize>2.8E-4</pixelSize>
      <scaleNames>
        <string>EPSG:5179:0</string>
        <string>EPSG:5179:1</string>
        <string>EPSG:5179:2</string>
      </scaleNames>
      <tileHeight>256</tileHeight>
      <tileWidth>256</tileWidth>
      <yCoordinateFirst>true</yCoordinateFirst>
    </gridSet>
  </gridSets>
  <layers/>
</gwcConfiguration>

 

 

위 2개의 코드를 보면 알겠지만, <blobStores>가 추가 되었다.

여기에 자신이 원하는 경로를 설정하면 해당 경로에 타일링 된 결과들이 저장된다. 끝

 

 

 

 

728x90
profile

개발공작소

@모찌바라기

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!