You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-67Lines changed: 74 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,6 @@ CLI for interacting with and preparing data for the [Mapbox Tiling Service](http
6
6
7
7
📚 If you have a question that isn't answered here, please refer to the complete [Mapbox Tiling Service documentation](https://docs.mapbox.com/mapbox-tiling-service/overview/).
8
8
9
-
10
9
# Contributing
11
10
12
11
[CONTRIBUTING.md](/CONTRIBUTING.md) includes information about release processes & running tests. :raised_hands:
@@ -21,68 +20,72 @@ CLI for interacting with and preparing data for the [Mapbox Tiling Service](http
21
20
## Basic installation
22
21
23
22
`pip install mapbox-tilesets` will install everything but [`estimate-area`](#estimate-area).
23
+
24
24
## Installing optional `estimate-area` command
25
+
25
26
If you are using an x86 Mac or Linux machine, run:
26
27
`pip install 'mapbox-tilesets[estimate-area]'`
27
28
28
29
Otherwise, you will need to install some dependencies.
29
30
30
31
### arm64 MacOS
32
+
31
33
If you're on an arm64 Mac (e.g., with an M1 chip), you'll need to install [GDAL](https://gdal.org/) first. On Mac, a simple way is to use [Homebrew](https://brew.sh/):
34
+
32
35
```sh
33
36
$ brew install gdal
34
37
...
35
38
$ pip install 'mapbox-tilesets[estimate-area]'
36
39
```
37
40
38
41
### Windows
42
+
39
43
Note, Windows is not officially supported at this time.
40
44
41
45
Windows users need to install [GDAL](http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal) and [rasterio](http://www.lfd.uci.edu/~gohlke/pythonlibs/#rasterio).
42
46
Then `pip install 'mapbox-tilesets[estimate-area]'`
43
47
44
-
45
-
46
48
## Mapbox Access Tokens
47
49
48
50
In order to use the tilesets endpoints, you need a Mapbox Access Token with `tilesets:write`, `tilesets:read`, and `tilesets:list` scopes. This is a secret token, so do not share it publicly!
49
51
50
52
You can either pass the Mapbox access token to each command with the `--token` flag or export it as an environment variable. Acceptable values are:
@@ -94,11 +97,13 @@ Uploads GeoJSON files to a source for tiling. Accepts line-delimited GeoJSON or
94
97
95
98
Please note that if your source data is a FeatureCollection, `tilesets` must read it all into memory to split it up into separate features before uploading it to the Tilesets API. You are strongly encouraged to provide your data in line-delimited GeoJSON format instead, especially if it is large.
96
99
100
+
Note: for large file uploads that are taking a very long time, try using the `--no-validation` flag.
101
+
97
102
Flags:
98
103
99
-
*`--no-validation`[optional]: do not validate source data locally before uploading
100
-
*`--replace`[optional]: delete all existing source data and replace with data from the file
101
-
*`--quiet`[optional]: do not display an upload progress bar
104
+
-`--no-validation`[optional]: do not validate source data locally before uploading, can be helpful for large file uploads
105
+
-`--replace`[optional]: delete all existing source data and replace with data from the file
106
+
-`--quiet`[optional]: do not display an upload progress bar
@@ -202,9 +207,9 @@ Estimates tiled area (km<sup>2</sup>) of features with a specified precision. Ac
202
207
203
208
Flags:
204
209
205
-
*`-p` or `--precision`[required]: precision level
206
-
*`--no-validation`[optional]: do not validate source data locally before area calculation
207
-
*`--force-1cm`[optional]: the --force-1cm flag must be present to enable 1cm precision area calculation and may take longer for large feature inputs or data with global extents. 1cm precision for tileset processing is only available upon request after contacting [Mapbox support](https://support.mapbox.com/hc/en-us/requests/new?ticket_form_id=360000291231)
210
+
-`-p` or `--precision`[required]: precision level
211
+
-`--no-validation`[optional]: do not validate source data locally before area calculation
212
+
-`--force-1cm`[optional]: the --force-1cm flag must be present to enable 1cm precision area calculation and may take longer for large feature inputs or data with global extents. 1cm precision for tileset processing is only available upon request after contacting [Mapbox support](https://support.mapbox.com/hc/en-us/requests/new?ticket_form_id=360000291231)
See more details about the recipe spec [here](https://docs.mapbox.com/help/troubleshooting/tileset-recipe-reference).
260
267
See recipe examples [here](https://docs.mapbox.com/help/troubleshooting/tileset-recipe-examples).
261
268
@@ -287,16 +294,16 @@ Creates a brand new, empty tileset with a recipe passed in from your local files
287
294
```shell
288
295
tilesets create <tileset_id> --recipe /path/to/recipe.json --name "My neat tileset"
289
296
```
290
-
The `tileset_id` is in the form of `username.handle` - for example "mapbox.neat-tileset". The handle may only include "-" or "\_" special characters and must be 32 characters or fewer.
291
297
298
+
The `tileset_id` is in the form of `username.handle` - for example "mapbox.neat-tileset". The handle may only include "-" or "\_" special characters and must be 32 characters or fewer.
292
299
293
300
Flags:
294
301
295
-
*`--recipe` or `-r`[required]: path to your Recipe JSON document
296
-
*`--name` or `-n`[required]: human-readable name of your tileset. (If your tileset_id is user.my_amazing_tileset, you might want your `name` field to be "My Amazing Tileset".)
297
-
*`--description` or `-d`: description of your tileset
298
-
*`--privacy` or `-p`: Set the privacy of the tileset. Allowed values are `private` and `public`. By default, new tilesets are private.
299
-
*`--attribution` or `-a`[optional]: set tileset attribution. Must be a JSON string, specifically an array of attribution objects, each with `text` and `link` keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values.
302
+
-`--recipe` or `-r`[required]: path to your Recipe JSON document
303
+
-`--name` or `-n`[required]: human-readable name of your tileset. (If your tileset_id is user.my_amazing_tileset, you might want your `name` field to be "My Amazing Tileset".)
304
+
-`--description` or `-d`: description of your tileset
305
+
-`--privacy` or `-p`: Set the privacy of the tileset. Allowed values are `private` and `public`. By default, new tilesets are private.
306
+
-`--attribution` or `-a`[optional]: set tileset attribution. Must be a JSON string, specifically an array of attribution objects, each with `text` and `link` keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values.
*`--description` or `-d`[optional]: update tileset description
327
-
*`--privacy` or `-p`[optional]: set your tileset to `public` or `private`
328
-
*`--attribution` or `-a`[optional]: set tileset attribution. Must be a JSON string, specifically an array of attribution objects, each with `text` and `link` keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values.
332
+
-`--name` or `-n`[optional]: update tileset name
333
+
-`--description` or `-d`[optional]: update tileset description
334
+
-`--privacy` or `-p`[optional]: set your tileset to `public` or `private`
335
+
-`--attribution` or `-a`[optional]: set tileset attribution. Must be a JSON string, specifically an array of attribution objects, each with `text` and `link` keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values.
329
336
330
337
### delete
331
338
@@ -337,7 +344,7 @@ tilesets delete <tileset_id>
337
344
338
345
Flags:
339
346
340
-
*`--force` or `-f` to bypass confirmation prompt.
347
+
-`--force` or `-f` to bypass confirmation prompt.
341
348
342
349
### status
343
350
@@ -371,8 +378,8 @@ tilesets jobs <tileset_id> --stage=processing
371
378
372
379
Flags:
373
380
374
-
*`--stage`[optional]: filter by the stage of jobs
375
-
*`--limit [1-500]`[optional]: the maximum number of results to return, from 1 to 500. The default is 100.
381
+
-`--stage`[optional]: filter by the stage of jobs
382
+
-`--limit [1-500]`[optional]: the maximum number of results to return, from 1 to 500. The default is 100.
376
383
377
384
### list
378
385
@@ -384,11 +391,11 @@ tilesets list <username>
384
391
385
392
Flags:
386
393
387
-
*`--type [vector|raster]`[optional]: filter results by tileset type
388
-
*`--visibility [public|private]`[optional]: filter results by visibility
389
-
*`--sortby [created|modified]`[optional]: sort results by their `created` or `modified` timestamps
390
-
*`--limit [1-500]`[optional]: the maximum number of results to return, from 1 to 500. The default is 100.
391
-
*`--verbose`[optional]: will list out the entire response object from the API
394
+
-`--type [vector|raster]`[optional]: filter results by tileset type
395
+
-`--visibility [public|private]`[optional]: filter results by visibility
396
+
-`--sortby [created|modified]`[optional]: sort results by their `created` or `modified` timestamps
397
+
-`--limit [1-500]`[optional]: the maximum number of results to return, from 1 to 500. The default is 100.
398
+
-`--verbose`[optional]: will list out the entire response object from the API
*`--secure`: By default, resource URLs in the retrieved TileJSON (such as in the "tiles" array) will use the HTTP scheme. Include this query parameter in your request to receive HTTPS resource URLs instead.
412
+
-`--secure`: By default, resource URLs in the retrieved TileJSON (such as in the "tiles" array) will use the HTTP scheme. Include this query parameter in your request to receive HTTPS resource URLs instead.
0 commit comments