<commit_before># Support Configuration Files

The OnEarth configuration process requires the following support configuration files:

* **Archive Configuration** - Configurable file system archive locations for logically separated MRFs.
* **Projection Configuration** - Projection-specific metadata required when building WMTS and TWMS service documents.
* **Environment Configuration** - Environment specific paths for items such as service location URLs.
* **Tile Matrix Sets** - WMTS TileMatrixSet XML elements used during WMTS GetCapabilities generation.
* **WMTS GetCapabilities Base** - XML content used as a base for the WMTS GetCapabilities XML during generation.
* **TWMS GetCapabilities Base** - XML content used as a base for the TWMS GetCapabilities XML during generation.
* **TWMS GetTileService Base** - XML content used as a base for the TWMS GetTileService XML during generation.


## Archive Configuration
The archive configuration file contains a listing of "archive" file system locations.  Each "archive" location represents a separate top level directory within which MRF files will be located.  This allows for logical organization of an MRF archive based on factors such as projection, mission, etc.  Each archive location is identified by a unique name, specified in the id attribute, which is used for to reference the archive location outside of the file.  A sample archive configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<ArchiveConfiguration>
    <Archive id="antarctic">
        <Location>/archive/imagery/antarctic/</Location>
    </Archive>
</ArchiveConfiguration>
```

## Projection Configuration
The projection configuration file contains a set of metadata elements for each projection supported during imagery access.  The metadata associated with each projections includes the following:

* **Well Known Text Spatial Reference System**  - The well-known text representation of the projection's spatial reference system providing a standard textual representation for spatial reference system information.  The definitions of the well-known text representation are modeled after the POSC/EPSG coordinate system data model. A dataset's coordinate system is identified by the PROJCS keyword if the data is in projected coordinates, by GEOGCS if in geographic coordinates, or by GEOCCS if in geocentric coordinates. WKT values can be found on the SpatialReference.org website.
* **WGS 84 Bounding Box** - The lower-left and upper-right corners defining the extent of the projection in WGS 84 (urn:ogc:def:crs:OGC:2:84) coordinate reference system.
* **"Native" Bounding Box** - The lower-left and upper-right corners defining the extent of the projection in the projection's coordinate reference system's units.

Each projection is identified by a unique name, specified in the id attribute, which is used for to reference the projection outside of the file.  A sample projection configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<ProjectionConfiguration>
    <Projection id="EPSG:3857">
        <WKT><![CDATA[PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"]]]]></WKT>
        <WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
            <LowerCorner>-180 -85</LowerCorner>
            <UpperCorner>180 85</UpperCorner>
        </WGS84BoundingBox>
        <BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
            <LowerCorner>-20037508.34278925 -20037508.34278925</LowerCorner>
            <UpperCorner>20037508.34278925 20037508.34278925</UpperCorner>
        </BoundingBox>
    </Projection>
    <Projection id="EPSG:4326">
        <WKT><![CDATA[GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]]]></WKT>
        <WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
            <LowerCorner>-180 -90</LowerCorner>
            <UpperCorner>180 90</UpperCorner>
        </WGS84BoundingBox>
    </Projection>
</ProjectionConfiguration>
```

## Environment Configuration

The environment configuration file contains information that the OnEarth layer configuration tool uses during service metadata and cache configuration file creation.  The information associated with each environment includes the following:

* **GetCapabilities Location** - The file system path where the WMTS and TWMS GetCapabilities XML files are copied after generation.
* **GetTileService Location** - The file system path where the TWMS GetTileService XML file should be placed for external access.
* **Cache Location** - The file system path where the WMTS and TWMS OnEarth cache config binary files are copied after generation.
* **Staging Location** - The file system path where intermediary and final configuration files are staged.
* **Service URL** - The base URL for WMTS and TWMS tiled access used during GetCapabilities XML creation.
* **Legend Location** - The file system path where legend images are copied after generation. 
* **Legend URL** - The base URL for external access to legend images.

The environment configuration does not have unique identifier.  Reference to the environment configuration is done through referencing the file path.  A sample environment configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<EnvironmentConfiguration>
    <GetCapabilitiesLocation service="wmts">/srv/www/onearth/wmts/antarctic/</GetCapabilitiesLocation>
    <GetCapabilitiesLocation service="twms">/srv/www/onearth/twms/antarctic/.lib/</GetCapabilitiesLocation>
    <GetTileServiceLocation>/srv/www/onearth/twms/antarctic/.lib/</GetTileServiceLocation>
    <CacheLocation>/archive/imagery/antarctic</CacheLocation>
    <StagingLocation service="wmts">/etc/onearth/config/wmts/EPSG3031/</StagingLocation>
    <StagingLocation service="twms">/etc/onearth/config/twms/EPSG3031/</StagingLocation>
    <ServiceURL service="wmts">http://onearth.project.org/wmts/antarctic/</ServiceURL>
    <ServiceURL service="twms">http://onearth.project.org/twms/antarctic/</ServiceURL>
    <LegendLocation>/usr/share/onearth/legends</LegendLocation>
    <LegendURL>http://onearth.project.org/legends/</LegendURL>
</EnvironmentConfiguration>
```

## TileMatrixSets
The Tile Matrix Sets configuration file contains a superset of all WMTS TileMatrixSet XML elements that are included in the WMTS GetCapabilities file during generation.  Tile Matrices are organized by projection.  The projection id identified by a unique name, specified in the id attribute, which is used for reference to the projection outside of the file.  The individual TileMatrixSet elements are uniquely identified by the Identifier child element, which is the primary identifier of the TileMatrixSet according to the WMTS specification.  A sample Tile Matrix Sets configuration file is included below:<commit_msg>GIBS-819 Updated configuration doc with new CacheLocation attributes<commit_after># Support Configuration Files

The OnEarth configuration process requires the following support configuration files:

* **Archive Configuration** - Configurable file system archive locations for logically separated MRFs.
* **Projection Configuration** - Projection-specific metadata required when building WMTS and TWMS service documents.
* **Environment Configuration** - Environment specific paths for items such as service location URLs.
* **Tile Matrix Sets** - WMTS TileMatrixSet XML elements used during WMTS GetCapabilities generation.
* **WMTS GetCapabilities Base** - XML content used as a base for the WMTS GetCapabilities XML during generation.
* **TWMS GetCapabilities Base** - XML content used as a base for the TWMS GetCapabilities XML during generation.
* **TWMS GetTileService Base** - XML content used as a base for the TWMS GetTileService XML during generation.


## Archive Configuration
The archive configuration file contains a listing of "archive" file system locations.  Each "archive" location represents a separate top level directory within which MRF files will be located.  This allows for logical organization of an MRF archive based on factors such as projection, mission, etc.  Each archive location is identified by a unique name, specified in the id attribute, which is used for to reference the archive location outside of the file.  A sample archive configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<ArchiveConfiguration>
    <Archive id="antarctic">
        <Location>/archive/imagery/antarctic/</Location>
    </Archive>
</ArchiveConfiguration>
```

## Projection Configuration
The projection configuration file contains a set of metadata elements for each projection supported during imagery access.  The metadata associated with each projections includes the following:

* **Well Known Text Spatial Reference System**  - The well-known text representation of the projection's spatial reference system providing a standard textual representation for spatial reference system information.  The definitions of the well-known text representation are modeled after the POSC/EPSG coordinate system data model. A dataset's coordinate system is identified by the PROJCS keyword if the data is in projected coordinates, by GEOGCS if in geographic coordinates, or by GEOCCS if in geocentric coordinates. WKT values can be found on the SpatialReference.org website.
* **WGS 84 Bounding Box** - The lower-left and upper-right corners defining the extent of the projection in WGS 84 (urn:ogc:def:crs:OGC:2:84) coordinate reference system.
* **"Native" Bounding Box** - The lower-left and upper-right corners defining the extent of the projection in the projection's coordinate reference system's units.

Each projection is identified by a unique name, specified in the id attribute, which is used for to reference the projection outside of the file.  A sample projection configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<ProjectionConfiguration>
    <Projection id="EPSG:3857">
        <WKT><![CDATA[PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"]]]]></WKT>
        <WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
            <LowerCorner>-180 -85</LowerCorner>
            <UpperCorner>180 85</UpperCorner>
        </WGS84BoundingBox>
        <BoundingBox crs="urn:ogc:def:crs:EPSG::3857">
            <LowerCorner>-20037508.34278925 -20037508.34278925</LowerCorner>
            <UpperCorner>20037508.34278925 20037508.34278925</UpperCorner>
        </BoundingBox>
    </Projection>
    <Projection id="EPSG:4326">
        <WKT><![CDATA[GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]]]></WKT>
        <WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
            <LowerCorner>-180 -90</LowerCorner>
            <UpperCorner>180 90</UpperCorner>
        </WGS84BoundingBox>
    </Projection>
</ProjectionConfiguration>
```

## Environment Configuration

The environment configuration file contains information that the OnEarth layer configuration tool uses during service metadata and cache configuration file creation.  The information associated with each environment includes the following:

* **GetCapabilities Location** - The file system path where the WMTS and TWMS GetCapabilities XML files are copied after generation.
* **GetTileService Location** - The file system path where the TWMS GetTileService XML file should be placed for external access.
* **Cache Location** - The file system path where the WMTS and TWMS OnEarth cache config binary and XML files are copied after generation. The base filename is specified using the "basename" attribute.
* **Staging Location** - The file system path where intermediary and final configuration files are staged.
* **Service URL** - The base URL for WMTS and TWMS tiled access used during GetCapabilities XML creation.
* **Legend Location** - The file system path where legend images are copied after generation. 
* **Legend URL** - The base URL for external access to legend images.

The environment configuration does not have unique identifier.  Reference to the environment configuration is done through referencing the file path.  A sample environment configuration file is included below:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<EnvironmentConfiguration>
    <GetCapabilitiesLocation service="wmts">/srv/www/onearth/wmts/antarctic/</GetCapabilitiesLocation>
    <GetCapabilitiesLocation service="twms">/srv/www/onearth/twms/antarctic/.lib/</GetCapabilitiesLocation>
    <GetTileServiceLocation>/srv/www/onearth/twms/antarctic/.lib/</GetTileServiceLocation>
    <CacheLocation service="wmts" basename="cache_all_wmts">/archive/imagery/antarctic/</CacheLocation>
    <CacheLocation service="twms" basename="cache_all_twms">/archive/imagery/antarctic/</CacheLocation>
    <StagingLocation service="wmts">/etc/onearth/config/wmts/EPSG3031/</StagingLocation>
    <StagingLocation service="twms">/etc/onearth/config/twms/EPSG3031/</StagingLocation>
    <ServiceURL service="wmts">http://onearth.project.org/wmts/antarctic/</ServiceURL>
    <ServiceURL service="twms">http://onearth.project.org/twms/antarctic/</ServiceURL>
    <LegendLocation>/usr/share/onearth/legends</LegendLocation>
    <LegendURL>http://onearth.project.org/legends/</LegendURL>
</EnvironmentConfiguration>
```

## TileMatrixSets
The Tile Matrix Sets configuration file contains a superset of all WMTS TileMatrixSet XML elements that are included in the WMTS GetCapabilities file during generation.  Tile Matrices are organized by projection.  The projection id identified by a unique name, specified in the id attribute, which is used for reference to the projection outside of the file.  The individual TileMatrixSet elements are uniquely identified by the Identifier child element, which is the primary identifier of the TileMatrixSet according to the WMTS specification.  A sample Tile Matrix Sets configuration file is included below:
{'fraction_non_alphanumeric': 0.10211449200618876, 'fraction_numerical': 0.03977565755544095, 'mean_word_length': 5.469140950792327, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 6, '>': 127, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1738891', 'n_tokens_mistral': 4774, 'n_tokens_neox': 4325, 'n_words': 1466}