Getting started with OGC API Tiles
This article describes how you can get started with working with OGC API Tiles in Carmenta Engine. We will first briefly describe the OGC API Tiles standard. After that, we will look into how you can use Carmenta Tile Engine to load your geodata and serve it as structured tiles. Lastly, we will look into how you can read these structured tiles from an OGC API Tiles service by using Carmenta Engine functionality.
The OGC API — Tiles standard
The OGC API - Tiles standard defines requirements for retrieving and publishing tiled geospatial data in a standardized way. In comparison to its predecessor OGC WMTS, the OGC API - Tiles standard support different forms of geospatial information such as maps, coverages and vector features. Currently the only supported type of geospatial information in Carmenta Engine is map tiles.
The OGC API Tiles (map tiles) is designed to provide image tiles that can be cached on both the server and clients for fast background maps and overlays. It is designed to be used with well known tiling schemes that can be combined with maps from other sources and that are compatible with map tiles from many large map service providers. See https://ogcapi.ogc.org/tiles for more information about the OGC API - Tiles standard.
Serving OGC API Tiles with Carmenta Tile Engine
Carmenta Tile Engine is setup to be easy to start up initially and only really requires you to open the appropriate port in your firewall (8080 is the default port). When using the Carmenta Engine SDK, the executable is named CarmentaTileEngine.exe and it is located in C:\Program Files\Carmenta\Carmenta Engine 5 SDK\bin on Windows. On Linux it is named carmenta-tile-engine and can be found in /usr/bin/.
By default it will use the Carmenta Engine SDK sample map configurations as services so you can try it out. You can browse the interface pages by opening the page http://localhost:[8080] in your browser. The sample configurations are good for trying things out, but you would probably want to eventually set the CTE_CATALOG_DIRECTORY setting to point to a directory where you have the configurations (.px-files) that you want to use in Carmenta Tile Engine.
OGC API has both a human usable interface using HTML pages and a programmatical interface using JSON. When designing a client configuration or using OGC API with a 3rd party client you will normally have to navigate the page hierarchy to find the appropriate link(s) for your client. The key pages here are the "collections" which contain the different services offered by the server and links for the tile sets that can be consumed by a client. In the Carmenta Tile Engine article you can read more about the structure of the interface pages and how to navigate both manually and programmatically.
Consuming OGC API Tiles in Carmenta Engine
Carmenta Engine has support for reading maps from an OGC API Tiles service and displaying them. There are currently two different ways you can access an OGC API Tiles service using Carmenta Engine. The first way is to use an OgcApiTilesLayer and the second one is to use an OGC API service as a remote catalog.
Using an OgcApiTilesLayer
The OgcApiTilesLayer is a layer that can be used to display map images from OGC API Tiles services. To get started, usually the only thing you need to configure is the HttpLayer.Url. This property should be set to one of two things. Either a link to a collection or a link to a specific tileset. The most simple thing to do is to set the HttpLayer.Url to a collection provided by the OGC API server. If you are running Tile Engine on port 8080 and would like to load the WorldMap collection and use it as a background map you would specify the HttpLayer.Url to the following.
http://localhost:8080/collections/WorldMap
Once the OgcApiTilesLayer initialize, it will automatically configure itself by requesting information about the collection from the OGC API server. Such information could be, for example, which Tile Matrix Sets that are available and which image formats that the server supports.
If you use a link to a collection as the HttpLayer.Url, the layer will automatically select the Tile Set that it thinks is the most suitable depending on the Crs of the View. However, it could be the case that you as developer want to use a specific Tile Set. To do this, it is also possible to specify the HttpLayer.Url to a link to a specific Tile Set. Lets say that you want to use the WorldMap which uses the WebMercatorQuad Tile Matrix Set, then you would set the HttpLayer.Url to the following.
http://localhost:8080/collections/WorldMap/map/tiles/WebMercatorQuad
Using an OGC API service as a remote catalog
Another way you can access an OGC API Tiles service is by using an OGC API as a remote Catalog. To create such a catalog, you will need to specify the Catalog.RootDirectory to point to an OGC API landing page. If you are using a Carmenta Tile Engine on port 8080, the URL should be set to the following.
http://localhost:8080
Once the remote catalog is initialized, it will find all available collections and create a CatalogMetadata instance for each found collection. Once that is done, you can load the collection, by passing its corresponding CatalogMetadata to the Catalog.LoadMap method. You can find more information about how you can work with Catalogs in the Catalog Mechanism Overview article.
Moreover, it is possible to open and display maps in a Catalog by using the Open Catalog Command in Carmenta Explorer. This can come in handy if you quickly want to examine which collections an OGC API service provides. The following screenshot shows the result of setting the Catalog Location to the landing page of a Carmenta Tile Engine with default settings.
![]() |