# Stack rasters

| **Description** | Retrieves a tif or png file of the styled raster stack.  |
| --------------- | -------------------------------------------------------- |
| **Endpoint**    | `/path/raster/timestamp/stack/{z}/{x}/{y}?token={token}` |
| **Method**      | GET                                                      |

### Access Level Rules

| **Minimum Access Level** | view |
| ------------------------ | ---- |

### Processing Units

| **Minimum processing units** | 1 |
| ---------------------------- | - |

## Parameters

<table><thead><tr><th width="354">Name</th><th width="212">Description</th><th width="134">Required</th><th>Default</th></tr></thead><tbody><tr><td><code>stack</code></td><td>An array of JSONs. Each JSON should have properties "pathId", "timestampId" and "bandNumber". The mentioned bands will be stacked in the order they are in the array.</td><td>true</td><td></td></tr><tr><td><code>style</code></td><td>An id of a style to apply or an object describing a valid style. <br><br>Valid object for style can be found here: <a href="https://docs.ellipsis-drive.com/developers/api-v3/path-raster/styles/add-style">https://docs.ellipsis-drive.com/developers/api-v3/path-raster/styles/add-style</a></td><td>true</td><td></td></tr><tr><td>x</td><td>The x coordinate of the tile.</td><td>true</td><td></td></tr><tr><td>y</td><td>The y coordinate of the tile.</td><td>true</td><td></td></tr><tr><td>z</td><td>The zoom level of the tile.</td><td>true</td><td></td></tr><tr><td><code>token</code></td><td>User’s login token. </td><td>false, token can also be passed in through the authorization header</td><td>Default null.</td></tr><tr><td><code>mask</code></td><td>A geojson polygon in wgs84 coordinates to mask the stack.</td><td>false</td><td>Default null.</td></tr></tbody></table>

Example of a valid stack request

```
// example of a valid stack:
stack=[
        {"pathId": "69661175-6aa6-4258-8114-f3f4093561ca", "timestampId": "e2233ac8-5357-48bd-a785-694af842e48e", "bandNumber": 1},
        {"pathId": "848b0931-62a3-41eb-a3c7-4c8203313381", "timestampId": "2c7ffef4-b906-4a64-921a-7e3493c6739e", "bandNumber": 1}
    ]
```

This creates a raster with two bands. Each band coming from the specified band, timestamp and layer combination.

{% hint style="info" %}
Mind that the stack is only defined in places where all the bands making up the stack are defined. All other location will be transparent. **If the referenced bands do not intersect anywhere there visualization will be transparent everywhere!**
{% endhint %}

A valid style for the above mentioned stack would be:

```
{
        "method":"formula",
        "name":"Visualization of my stack"
        "parameters":{      
          "formula": "band2 - band1",
          "alpha": 1,
          "continuous": true,
          "transitionPoints":[{"color":"#2A5C84","value":25},{"color":"#74AE56","value":129.5},{"color":"#FFE733","value":234},{"color":"#FF8C01","value":338.5},{"color":"#ED2938","value":443}]
    }
}


```

This visualizes the difference between the first and second band in the stack.

See [here](https://docs.ellipsis-drive.com/developers/api-v3/path-raster/styles) to find how to create a style object.
