Skip to content

Commit 78681cb

Browse files
authored
Merge pull request #157 from tilezen/nvkelso/more-512px-buffered-docs-off-v1.0.0-docs11
[docs] better 512 px tile size documenation
2 parents 9a90e9a + bddc3a7 commit 78681cb

File tree

1 file changed

+102
-3
lines changed

1 file changed

+102
-3
lines changed

docs/use-service.md

+102-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ Once you have your Mapzen API key you'll need include it with Terrain Tile reque
1414

1515
## Requesting tiles
1616

17+
The [OpenStreetMap Wiki](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) describes the web mapping tile scheme used by the Mapzen terrain tile service.
18+
1719
Request a single tile with this URL pattern to get started:
1820

1921
```
2022
https://tile.mapzen.com/mapzen/terrain/v1/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
2123
```
2224

23-
The [OpenStreetMap Wiki](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) has more information on this url scheme.
25+
Some formats support a `tilesize` option, see below for more information:
26+
27+
```
28+
https://tile.mapzen.com/mapzen/terrain/v1/{tilesize}/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
29+
```
2430

25-
Heres a sample tile in Normal format:
31+
Here's a sample tile in Normal format:
2632

2733
```
2834
http://tile.mapzen.com/mapzen/terrain/v1/normal/11/330/790.png?api_key=your-mapzen-api-key
@@ -68,6 +74,99 @@ https://tile.mapzen.com/mapzen/terrain/v1/skadi/{N|S}{y}/{N|S}{y}{E|W}{x}.hgt.gz
6874

6975
Note: Skadi files are split into 1° by 1° grids. File names refer to the latitude and longitude of the lower left corner of the tile - e.g. N37W105 has its lower left corner at 37 degrees north latitude and 105 degrees west longitude. For example: N37W105: `https://tile.mapzen.com/mapzen/terrain/v1/skadi/N37/N37W105.hgt.gz?api_key=your-mapzen-api-key`.
7076

77+
## Specify tile size
78+
79+
Both Terrarium and Normal formats support optional tile sizes of `256` and `512` for basic map display, and buffered sizes of `260` and `516` pixels useful for 3d and analytical applications. When not provided, the size defaults to `256`. Historically, the first web slippy maps were based on 256 pixel sized tiles.
80+
81+
```
82+
https://tile.mapzen.com/mapzen/terrain/v1/{tilesize}/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
83+
```
84+
85+
**Larger 512 pixel sized tiles offer several benefits:**
86+
87+
- **Less tiles, less network requests:** a single 512 request is equivalent to four 256 requests
88+
- **Smaller overall file sizes:** A larger 512 pixel tile compresses to a smaller file size than when split into four 256 tiles
89+
- **Offline:** Less 512 tiles are needed to cover the same geographic area, and take up less disk space
90+
91+
**Buffered 260 and 516 pixel sized tiles offer several benefits:**
92+
93+
- **Less network requests:** The 2 pixel edge buffers reduce network requests from 9 to 1, as sampling neighboring tiles is no longer necessary. And a single 516 request is equivalent to four 260 requests.
94+
- **3D geometry construction**: The buffer provides enough height values in the overlap to calculate 3D elevation meshes without loading neighboring tiles.
95+
- **Enables professional shading for 3D**: The 2nd pixel of buffer enables custom normals (slopes) to be calculated for the 1st pixel of the terrarium buffer without loading neighboring tiles.
96+
97+
### 256 tile size (default)
98+
99+
The maximum `{z}` value for 256 pixel tiles is zoom **15**. Requesting `{z}` coordinates past that will result in a 404 error.
100+
101+
**Default:**
102+
103+
Including tile size in the path is not required. When not specified the default size of `256` is returned, and Tangram's default `tile_size` of 256 is used.
104+
105+
```
106+
https://tile.mapzen.com/mapzen/terrain/v1/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
107+
```
108+
109+
**Example Tangram YAML:**
110+
111+
```
112+
sources:
113+
mapzen:
114+
type: Raster
115+
url: https://tile.mapzen.com/mapzen/terrain/v1/normal/{z}/{x}/{y}.png
116+
url_params:
117+
api_key: your-mapzen-api-key
118+
max_zoom: 15
119+
```
120+
121+
**256 in path:**
122+
123+
```
124+
https://tile.mapzen.com/mapzen/terrain/v1/256/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
125+
```
126+
127+
### 512 tile size
128+
129+
The maximum `{z}` value for 512 pixel tiles is zoom **14**. Requesting `{z}` coordinates past that will result in a 404 error.
130+
131+
**512 in path:**
132+
133+
```
134+
https://tile.mapzen.com/mapzen/terrain/v1/512/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
135+
```
136+
137+
**Example Tangram YAML:**
138+
139+
```
140+
sources:
141+
mapzen:
142+
type: MVT
143+
url: https://tile.mapzen.com/mapzen/terrain/v1/512/normal/{z}/{x}/{y}.png
144+
url_params:
145+
api_key: your-mapzen-api-key
146+
tile_size: 512
147+
max_zoom: 14
148+
```
149+
150+
### 260 tile size
151+
152+
The maximum `{z}` value for 260 pixel buffered tiles is zoom **15**. Requesting `{z}` coordinates past that will result in a 404 error. Supported by Terrarium and Normal formats.
153+
154+
**260 in path:**
155+
156+
```
157+
https://tile.mapzen.com/mapzen/terrain/v1/260/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
158+
```
159+
160+
### 516 tile size
161+
162+
The maximum `{z}` value for 516 pixel buffered tiles is zoom **14**. Requesting `{z}` coordinates past that will result in a 404 error. Supported by Terrarium and Normal formats.
163+
164+
**516 in path:**
165+
166+
```
167+
https://tile.mapzen.com/mapzen/terrain/v1/516/{format}/{z}/{x}/{y}.{extension}?api_key=your-mapzen-api-key
168+
```
169+
71170
#### Additional Amazon S3 Endpoints
72171

73172
If you’re building in Amazon AWS we recommend using machines in the `us-east` region (the same region as the S3 bucket) and use the following endpoints for increased performance:
@@ -77,7 +176,7 @@ If you’re building in Amazon AWS we recommend using machines in the `us-east`
77176
* `https://s3.amazonaws.com/elevation-tiles-prod/geotiff/{z}/{x}/{y}.tif`
78177
* `https://s3.amazonaws.com/elevation-tiles-prod/skadi/{N|S}{y}/{N|S}{y}{E|W}{x}.hgt.gz`
79178

80-
NOTE: The S3 tiles are meant for efficient networking with EC2 resources only. The Amazon S3 endpoints are not cached using Cloudfront, but you could put your own Cloudfront or other CDN in front of them (or use Mapzen's hosted Terrain Tiles service).
179+
NOTE: The S3 tiles are meant for efficient networking with EC2 resources only. Terrarium and normal formats are only available as 256 tile size on the Amazon S3 endpoints. The Amazon S3 endpoints are not cached using Cloudfront, but you could put your own Cloudfront or other CDN in front of them (or use Mapzen's hosted Terrain Tiles service).
81180

82181
## Security
83182

0 commit comments

Comments
 (0)