Copy for LLM[View as Markdown](https://docs.planet.com/develop/apis/tiles/) # Tile Services The [API Tile Service](#api-tile-service) and [Mosaic Tile Service](#mosaic-tile-service) make it easy to visualize Planet imagery in desktop or web mapping applications that support either the [XYZ](https://docs.planet.com/develop/apis/tiles/xyz.md) or the [WMTS](https://docs.planet.com/develop/apis/tiles/wmts.md) protocol. Planet tile services provide a way for web developers and GIS analysts to interact with, and derive value from Planet imagery without additional image processing. ## Authentication A valid Planet account is required to access either of the tile services (XYZ or WMTS). Authenticate by providing a valid `api_key` as a query parameter to all tile requests. info You must be authenticated to use Planet tile services. If you do not have the correct permissions, the tile request results in a 404 error. To be properly authenticated, provide a valid `api_key` as a query parameter in all tile requests. ## API Key Security Your Planet API key grants you access to Planet products. Like other credentials, you must take precautions to ensure it stays secure. If you use your API key to load tiles for web map applications, additional steps are required to keep the key secure. Do not commit your API key to code repositories, do not store or use the API key in code used by the public or your users (For example, frontend web applications), and make sure that requests made by web applications you create do not expose the API key while fetching tiles. We recommend that you use your API keys only within secure environments that you control. For security purposes, applications running on end users' systems must not fetch tiles directly from Planet using your API key. This includes web applications that users access with their browser. Contact [Planet Support](https://support.planet.com) to obtain a new key or if your API key is shared or exposed. ## Tile Service URLs The Planet tile services provide tiles by using the following domains: * `https://tiles0.planet.com` * `https://tiles1.planet.com` * `https://tiles2.planet.com` * `https://tiles3.planet.com` Load more tiles concurrently in web browsers by using multiple subdomains. Libraries such as [OpenLayers](https://openlayers.org/) and [Leaflet](http://leafletjs.com/) provide the ability to access all subdomains by using the proper string patterns. note The Tile Services API does not have rate limits. For general rate limiting information, see the [rate limiting](https://docs.planet.com/develop/rate-limiting.md) page. ## API Tile Service The API Tile Service acts as an extension to the Planet API by visually listing the Planet assets that are available in the [item archive](https://docs.planet.com/develop/apis/data.md) as tiles. The imagery returned by the tile service is a compressed version of the high-quality visual asset, making it easy to incorporate into any supporting client. Currently, only clients using the [XYZ tile protocol](https://docs.planet.com/develop/apis/tiles/xyz.md#xyz-protocol-overview) are supported. **API Tile Service Request Structure** ``` https://tiles{0-3}.planet.com/data/v1/{item_type}/{item_id}/{z}/{x}/{y}.png?api_key={pl-api-key} ``` **API Tile Service Request in Python with Basic HTTP Authentication** * Python ``` import os # import os module to access environmental modules import requests from requests.auth import HTTPBasicAuth # import helper functions to make Basic request to Planet API PLANET_API_KEY = os.getenv("PL_API_KEY") # Setup the API Key from the `PL_API_KEY` environment variable BASE_URL = "https://tiles{0-3}.planet.com/data/v1/{item_type}/{item_id}/{z}/{x}/{y}.png" if PLANET_API_KEY is None: PLANET_API_KEY = "12345" # pass in your API key auth = HTTPBasicAuth(PLANET_API_KEY, "") # HTTPBasicAuth() wants a username & password; you can pass an empty string for the password res = requests.get(url=BASE_URL, auth=auth) print(res.status_code) # make a request to Tile Services API and test the response ``` | Parameter | Value | | ---------- | ------------------------------ | | item\_type | Item type of the item to view. | | item\_id | Item id of the item to view. | | z | Tile zoom level. | | x | Tile row in the grid. | | y | Tile column in the grid. | The following example is a complete URL for a tile request for the `PSScene` item with an `id` of `20161221_024131_0e19`: ``` https://tiles1.planet.com/data/v1/PSScene/20161221_024131_0e19/14/12915/8124.png?api_key={pl-api-key} ``` ## Mosaic Tile Service The Mosaic tile service provides access to tiles for weekly or monthly, color corrected global mosaics. The Mosaic tile service works with any client that supports the [XYZ](https://docs.planet.com/develop/apis/tiles/xyz.md#xyz-protocol-overview) or the [WMTS](https://docs.planet.com/develop/apis/tiles/wmts.md#wmts-protocol-overview) protocol. Details on Planet specifications are available in [PlanetScope Mosaics Product Specifications](https://assets.planet.com/products/basemap/planet-basemaps-product-specifications.pdf). ## Dynamically Rendering False-Color Indices The PlanetScope Surface Reflectance Mosaic products are also available in false-color visualizations to support a wider range of analysis. Currently the following seven band combinations and indices are available via Tile Service: * Red-Green-Blue (RGB) * Color-infrared (CIR) * Normalized Difference Vegetation Index (NDVI) * Normalized Difference Water Index (NDWI) * Visual Atmosphere Resistance Index (VARI) * Modified Soil-adjusted Vegetation Index (MSAVI2) * Modified Triangular Vegetation Index (MTVI2) * Triangular Greenness Index (TGI) note False-color indices and band math visualizations are available only on Surface Reflectance Mosaics. ## Remote Sensing Indices | Index | Formula | Legend | URL Parameters | | ------ | ------------------------------------------------------------------------------------------------------ | ------ | -------------- | | NDVI | $\frac{ir - r}{ir + r}$ | | `?proc=ndvi` | | NDWI | $\frac{g - ir}{g + ir}$ | | `?proc=ndwi` | | MSAVI2 | $\frac{2 * ir + 1 - \sqrt{(2 * ir + 1)^2 - 8(ir - r)}}{2}$ | | `?proc=msavi2` | | MTVI2 | $\frac{1.5 * ( 1.2 * (ir - g) - 2.5 * (r - g)}{\sqrt{(2 * ir + 1) ^ 2 - (6 * ir -5 * \sqrt{r})} - .5}$ | | `?proc=mtvi2` | | VARI | $\frac{g - r}{g + r - b}$ | | `?proc=vari` | | TGI | $\frac{(120 * (r - b)) - (190 * (r - g))}{2}$ | | `?proc=tgi` | ## Additional Resources [🎓Planet University](https://university.planet.com/) [Dive deeper into Planet services with guides and tutorials](https://university.planet.com/) [Tile Services in ArcGIS Online](https://docs.planet.com/platform/integrations/arcgis/ogc-services-arcgis.md) [Explore Using Planet Tile Services in ArcGIS Online](https://docs.planet.com/platform/integrations/arcgis/ogc-services-arcgis.md)