diff --git a/analytics.md b/analytics.md
index 2496a15..253b29f 100755
--- a/analytics.md
+++ b/analytics.md
@@ -2,32 +2,31 @@
-*This API is available for [Commercial and Enterprise](https://www.mapbox.com/pricing/) plans.*
-
-The Mapbox Analytics API returns API usage for services by resource. For example, it can calculate the number of geocoding requests made in a week with a specific access token.
+*这份API适用于 [ Commercial and Enterprise ](https://www.mapbox.com/pricing/) 计划。*
+此Mapbox Analytics API 将按资源返回服务的API使用情况。例如,它可以通过一个特定的访问token来计算过去一周内发起的地理编码请求的次数。
```python
from mapbox import Analytics
```
### Retrieve analytics
-Returns the request counts per day for given resource and period.
+根据给出的资源和时段返回按天统计的某一请求发起的次数。
-* If the `{resourceType}` is `tokens`, the `{id}` is the complete token.
-* If the `{resourceType}` is `styles`, the `{id}` is the Style ID. Not to be confused with the Style _URL_, the id is the alphanumeric segment at the end of the style: the Style URL `mapbox://styles/user/cimdoca6f00` contains the Style ID `cimdoca6f00`, so the analytics request would have the path `/analytics/v1/styles/user/cimdoca6f00`.
-* If the `{resourceType}` is `tilesets`, the `{id}` is a Map ID.
+* 如果 `{resourceType}` 是 `tokens`, 则 `{id}` 是完整的token。
+* 如果 `{resourceType}` 是 `styles`, 则 `{id}` 是Style ID。注意不要与 Style _URL_ 混淆,此 id 是样式末尾的字母数字部分: 此 Style URL `mapbox://styles/user/cimdoca6f00` 包含Style ID `cimdoca6f00`, 所以此分析请求的路径则为 `/analytics/v1/styles/user/cimdoca6f00`。
+* 如果 `{resourceType}` 是 `tilesets`, 则 `{id}` 是一个 Map ID.
```endpoint
GET /analytics/v1/{resourceType}/{username}/{id}?period={period} analytics:read
```
-URL Parameter | Description
+URL 参数 | 描述
--- | ---
-`resourceType` | The resource being requested. Valid resource types are `accounts`, `tokens`, `tilesets` or `styles`.
-`username` | The username for the account that owns the resource.
-`id`
(optional) | The id for the resource. In the case of `accounts` this isn't required.
-`period`
(optional) | 2 comma separated dates as [ISO formatted strings](#dates). The first date must be earlier than the second. The period is inclusive of dates provided. Defaults to last 90 days if not provided. The maximum period is 1 year. If the provided dates are more than 1 year apart, an error will be returned.
+`resourceType` | 被请求的资源类型。可用的类型有 `accounts`, `tokens`, `tilesets` 和 `styles`。
+`username` | 拥有此资源的账户用户名。
+`id`
(可选) | 此资源的id。如果类型为 `accounts` 则此项不必需。
+`period`
(可选) | 由两个逗号分割的格式为 [ISO formatted strings](#dates)的日期。 第一个日期必须早于第二个日期。区间包括给出的日期。如果未提供此项,则默认为过去的90天。最长区间为1年。如果提供的两个日期相隔超过1年,则会返回一个错误。
#### Example Request
@@ -76,21 +75,21 @@ response = analytics.analytics('accounts', '{username}')
}
```
-Responses include arrays of request counts per service.
+包含每项服务各请求数目数组的响应。
-Property | Description
+属性 | 描述
--- | ---
-`timestamps` | an array of dates as ISO formatted strings for each day included in the response.
-`period` | a 2 element array with start and end dates as ISO formatted strings for the response period.
-`services` | an object with a key per service the value of which is an array of request counts per day in the same sequence as `timestamps`.
+`timestamps` | 包含在此响应中的 ISO formatted strings 类型的日期数组。
+`period` | 一个包含两个元素的数组,分别为此响应区间的 ISO formatted strings 类型的开始与结束日期。
+`services` | 每一项服务对应的一个带密钥对象。其值为记录每天请求数量的一个数组,顺序与 `timestamps` 中的时序一致。
-Only services applicable to the given resource are returned in the response.
+只有适用于给出的资源的服务会在响应中被返回。
-Resource type | Services returned in response
+资源类型 | 在响应中被返回的服务
--- | ---
`accounts` | `mapview` `static` `tile` `directions` `geocode`
`tokens` | `mapview` `static` `tile` `directions` `geocode`
`tilesets` | `mapview` `static` `tile`
`styles` | `mapview` `static` `tile`
-For the `styles` resource type, Static & Tile services refer to the [Static API](#static). For `tilesets`, Static & Tile services refer to the [Static (Classic)](#static-classic) and [Maps → Tiles](#retrieve-tiles) APIs.
+对于 `styles` 资源类型, Static 和 Tile 服务请参考 [Static API](#static)。 对于 `tilesets`资源类型, Static 和 Tile 服务请参考 [Static (Classic)](#static-classic) 和 [Maps → Tiles](#retrieve-tiles) APIs。
diff --git a/fonts.md b/fonts.md
index ed3396f..e3ac4a8 100755
--- a/fonts.md
+++ b/fonts.md
@@ -1,39 +1,39 @@
-## Fonts
+## 字体
-The Mapbox Fonts API accepts fonts as raw binary data, allows those fonts to be deleted, and generates encoded letters for map renderers. Two types of fonts are supported: TrueType fonts, usually with `.ttf` file extensions, and OpenType fonts, with `.otf` extensions.
+Mapbox字体API接受形式为原始二进制码的字体,允许删除这些字体,并且为地图渲染器生成代码。它支持两种类型的字体:TrueType字体,文件后缀名通常为`.ttf`,以及OpenType字体,后缀名为`.otf`。
-Fonts are managed on a per-account basis. Styles can use any font from the same account.
+字体按账户来管理。同一账户可以在样式中使用任何字体。
-**Restrictions and limits**
+**限制和约束**
-- Fonts must be smaller than 30MB.
-- Accounts are limited to 100 fonts.
+- 字体必须小于30MB。
+- 每个账户最多使用100个字体。
-### Retrieve font glyph ranges
+### 检索字体字形范围
```endpoint
GET /fonts/v1/{username}/{font}/{start}-{end}.pbf fonts:read
```
-While glyph ranges are usually not of interest unless you're building a map renderer, this is the endpoint you can use to access them.
+虽然字形范围一般不被关注,除非你正在建立一个地图渲染器,但这是访问它们的端点。
-Font glyph ranges are protocol buffer-encoded signed distance fields. They can be used to show fonts at a variety of scales and rotations. One glyph is used at all scales.
+字体字形范围是协议缓冲编码的带符号距离字段。它们可用于显示各种比例和旋转的字体。一个字形支持所有比例。
-URL Parameter | Description
+URL 参数 | 描述
--- | ---
-`username` | The username of the account to which the font belongs.
-`font` | The name of the font. This endpoint supports queries with multiple comma-separated font names.
-`start` | A multiple of `256` between `0` and `65280`.
-`end` | The number indicated by `start`, plus `255`.
+`username` | 该字体所属账户的用户名。
+`font` | 字体的名称。此端点支持查询多个字体名称,名称间用逗号隔开。
+`start` | `0`到`65280`之间`256`的倍数。
+`end` | `start`显示的数字加上`255`。
-**Response body**
+**响应主体**
-A successful request will return `HTTP 200 Success`. The response body will be a buffer of the glyphs with `Content-Type: application/x-protobuf`.
+一个成功的请求将会返回`HTTP 200 Success`。响应主体将会是字形的一个缓存,字形带有`Content-Type: application/x-protobuf`。
-#### Example request
+#### 示例请求
```curl
-# Query contains 2 comma-separated font names
+# 查询包含两个由逗号分隔的字体名
curl "https://api.mapbox.com/fonts/v1/examples/DIN Offc Pro Medium,Arial Unicode MS Regular/0-255?access_token={your_access_token}"
```
@@ -51,26 +51,26 @@ stylesClient
```
```python
-# This API cannot be accessed with the Python SDK
+# 无法使用Python SDK访问此API
```
```bash
-This API cannot be accessed with Mapbox CLI
+无法使用Mapbox CLI访问此API
```
```java
-// This API cannot be accessed with the Mapbox Java SDK
+// 无法使用Mapbox Java SDK访问此API
```
```objc
-// This API cannot be accessed with the Mapbox Objective-C libraries
+// 无法使用Mapbox Objective-C 库访问此API
```
```swift
-// This API cannot be accessed with the Mapbox Swift libraries
+// 无法使用Mapbox Swift库访问此API
```
-#### Response
+#### 响应
> `HTTP 200 Success`
diff --git a/topics.md b/topics.md
index bd07e3d..4d4437e 100755
--- a/topics.md
+++ b/topics.md
@@ -1,152 +1,125 @@
-## Reading this Documentation
-
-This documentation is structured by API, which is a group of related functionality
-like [Geocoding](#geocoding) or [Uploads](#uploads), and then by endpoint, which
-is a specific method within that API that performs one action and is located
-at a specific URL.
-
-Each endpoint in this documentation is described using several parts:
-
-* The HTTP method: includes GET, POST, PUT, PATCH, DELETE
-* The path: for instance, `/geocoding/v5/{mode}/{query}.json`
-* URL parameters: these are the parts of the endpoint path wrapped in brackets,
- like `{mode}` in this example.
-* Query parameters: contained in a table with an _Option_ header, these are added
- to the query string part of the request.
-* A token scope, if one is required.
-
-All URLs referenced in the documentation have the base path `https://api.mapbox.com`.
-This base path goes _before_ the endpoint path. In this example, you'd
-combine `https://api.mapbox.com` and `/geocoding/v5/{mode}/{query}.json` to get
-the request URL `https://api.mapbox.com/geocoding/v5/{mode}/{query}.json`.
-
-For this endpoint, `{mode}` and `{query}` are the URL parameters. In a request,
-you replace their placeholders with real values: for instance, you'd choose
-`mapbox.places` as your mode and `Chester` as your query, and get the URL
-`https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json`
-
-Query parameters are added to the end of the URL with [query string encoding](https://en.wikipedia.org/wiki/Query_string).
-If you wanted to add the `country` query parameter to that Geocoding request, you'd
-the query string `?country=us` to the end of the URL, producing
-`https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us`.
-
-All endpoints require an access token, which is provided as a query parameter.
-So the final geocoding request you would construct would look like
-`https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us&access_token=pk.my-token-value`
-The next section covers how you get and use access tokens.
+## 阅读这篇文档
+
+这篇文档是由如[Geocoding](#geocoding)或[Uploads](#uploads)这样一组相关功能的API和相关服务端点构成,每个服务端点是一个API中用于执行某个操作并位于特定URL的特定方法
+
+本文档中的每个服务端点使用如下几个部分描述:
+
+* HTTP方法: 包含GET, POST, PUT, PATCH和DELETE
+* 路径: 例如`/geocoding/v5/{mode}/{query}.json`
+* URL参数: 这些参数是服务端点路径中括号括起来的部分,
+ 像例子中的`{mode}`.
+* 查询参数: 包含在一个有 _Option_ 请求头的表中, 并且这些参数被添加到请求的查询字符部分.
+* 令牌作用域, 如果在需要一个令牌的情况下.
+
+所有文档中提到的URL有以下基本路径
+`https://api.mapbox.com`.
+这个基本路径在服务端点路径之前. 在这个例子中,你需要把 `https://api.mapbox.com`和 `/geocoding/v5/{mode}/{query}.json`组合得到请求的URL `https://api.mapbox.com/geocoding/v5/{mode}/{query}.json`.
+
+在这个服务端点中, `{mode}`和 `{query}`是URL参数. 在一个请求中,你将用真实值去替换对应的占位符: 例如,你应该选择 `mapbox.places`作为你的模式, `Chester`作为你要查询的目标, 并得到这样的URL `https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json`
+
+查询参数是用[查询字符串编码](https://en.wikipedia.org/wiki/Query_string)来添加到URL的结尾.如果你想把 `country` 这个请求参数添加到这个Geocoding请求中,你应该把查询字符串 `?country=us`加到URL的结尾, 得到`https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us`.
+
+所有的服务端点需要一个访问令牌, 这个令牌是作为一个查询参数被提供的.
+所以最终你要构造的geocoding请求会是这样`https://api.mapbox.com/geocoding/v5/mapbox.places/Chester.json?country=us&access_token=pk.my-token-value`.
+下一章节包括你将如何获得和使用访问令牌.
```http
https://api.mapbox.com
```
-## Access tokens
+## 访问令牌
-Access to Mapbox web services requires an [access token](https://mapbox.com/help/define-access-token) that connects API
-requests to your account. The example requests in this documentation don't include
-an access token: you will need to supply one using the `access_token` query
-option or by specifying the token in the SDK or library.
+访问Mapbox的web服务需要一个[访问令牌](https://mapbox.com/help/define-access-token), 这个访问令牌会连接API请求到你的账户. 本文档中的示例请求不包括访问令牌: 你需要使用`access_token`查询选项来提供一个或者在SDK或者库中指定一个令牌.
-Your default access token is available on your
-[Account Dashboard](https://www.mapbox.com/account). You can also manage
-and create additional tokens on your [Access tokens page](https://www.mapbox.com/account/access-tokens/) or with the [Tokens API](#tokens).
+在你的[账户面板](https://www.mapbox.com/account)中可以得到默认访问令牌. 你也可以在你的[访问令牌页](https://www.mapbox.com/account/access-tokens/)或者使用[Tokens API](#tokens)管理和创建附加的令牌.
-#### Access token example
+#### 访问令牌用例
```http
https://api.mapbox.com/{endpoint}?access_token={your_access_token}
```
-When creating a new access token, you have the option of adding one or more **scopes**.
-Each scope adds a different permission to the token, allowing it to be used to
-access restricted APIs. Throughout the documentation, we specify the scope
-required to access each endpoint.
+当创建一个新的访问令牌时, 您可以选择添加一个或多个**作用域**.
+每个作用域为令牌添加了不同的权限来用于
+访问受限API. 在整个文档中, 我们指定了访问每个服务端点所必需的作用域.
-## Versioning
+## 版本控制
-Each Mapbox API is versioned with a version string specified in the base URL that
-can be incremented independently from other APIs.
+每个 Mapbox API 都可基于 URL 指定所期望的 api 版本, 并可使得该 API 版本控制独立于其他 api 递增。
-#### Versioning example
+#### 版本控制例子
```http
https://api.mapbox.com/{api}/{version}
```
-_The [Maps API](#maps) is an exception: its endpoint is prefixed
-with `/v4/{map_id}` instead of putting the version after the API name.
-This mismatch will be fixed in the next API version._
+_[Maps API](#maps) 是一个例外: 他的 endpoint 是以 `/v4/{map_id}` 为前缀,而不是将版本号放在 api
+名称后,这个特例将在下一个 api 版本中修复。_
-Using the newest available API is always encouraged.
+我们始终建议您使用最新版本的 API。
-These changes are considered backwards compatible and will
-not require the version string to be incremented:
+以下改动将会被认定为具有向后兼容性,当其发布时我们将不会更新版本号:
-- Adding properties to JSON objects.
-- Changing the number of items returned in a single listing request.
-- Changing rate limiting thresholds.
-- The structure or length of identifiers generated by the API.
-- Changing error messages.
+- JSON 对象中增加新的属性。
+- 更改单个列表请求中返回的项数。
+- 更改速率限制的阈值。
+- 更改 API 自动生成的 ID 标识符的结构或长度。
+- 更改错误信息。
-These changes are considered backwards incompatible and will require
-the version string to be incremented:
+以下改动将会被认定为不具有向后兼容性,当其发布时我们将会更新版本号:
-- Removing properties from JSON objects.
-- Changing an API's URL structure
+- JSON 对象移除一些属性。
+- 更改 API 的 url 结构
-In the event that certain functionality is deprecated, we will give at least
-90 days notice via email. You will only receive a deprecation email if we
-detect you are using part of the API that is being deprecated.
+当决定某些功能将要被弃用[deprecated], 我们至少在生效前 90 天通过电子邮件通知您。当我们检测到您使用的 API
+中存在弃用功能时,我们也会给您发送电子邮件。
-## Rate limits
+## 速率限制
-Mapbox APIs have rate limits that cap the number of requests
-that can be made against an endpoint. If you exceed a rate limit, your
-request will be throttled and you will receive `HTTP 429 Too Many Requests`
-responses from the API.
+Mapbox APIs 将会对每个 endpoint 的请求量进行速率限制。如果您超出了速率限制,您的请求将会被拒接,并会收到
+API 的请求相应 `HTTP 429 Too Many Requests` 。
-| Header | Description |
+| Header | 描述 |
| --- | --- |
-| `X-Rate-Limit-Interval` | Length of rate-limiting interval in seconds. |
-| `X-Rate-Limit-Limit` | Maximum number of requests you may make in the current interval before reaching the limit. |
-| `X-Rate-Limit-Reset` | Unix timestamp of when the current interval will end and the ratelimit counter is reset.|
+| `X-Rate-Limit-Interval` | 速率限制的间隔长度。(以秒为单位) |
+| `X-Rate-Limit-Limit` | 每个速率限制间隔期中可进行的最大请求数。|
+| `X-Rate-Limit-Reset` | 一个 unix 时间戳,在当前时间间隔且速率限制计数器被重置时的时间。|
## CORS
-Mapbox web services support [Cross-Origin
-Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) with no domain restrictions.
-To support Internet Explorer 8 and 9, use a library that falls back to
-XDomainRequest, like [corslite](https://github.com/mapbox/corslite/).
+Mapbox web 服务支持不受域限制的 [跨源请求(Cross-Origin Requests)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) 。 为了支持 IE 8 和 IE9,请使用相关的库 例如
+[corslite](https://github.com/mapbox/corslite/) ,让请求退回到 XDomainRequest,
## Retina
```http
-# a 400x200 static map
+# 一张400x200静态地图
https://api.mapbox.com/v4/mapbox.dark/-76.9,38.9,5/400x200.png?access_token={your_access_token}
-# the same static map for Retina
-# displays: this image will be 800x400
-# pixels, but show the same content
-# and look the same when scaled down
+# 相同的静态地图Retina
+# 显示:这个图像将是800x400
+# 像素,但是显示相同的内容
+# 比例缩小后看起来也一样
https://api.mapbox.com/v4/mapbox.dark/-76.9,38.9,5/400x200@2x.png?access_token={your_access_token}
```
-Mapbox supports Retina image output on all APIs that serve images.
-Add `@2x` before the file extension on a URL to request an image at
-double scale. For instance, a map tile that is 256×256 pixels will be
-512×512 pixels with `@2x`, but show the same content. When displayed
-on a page, the image will be still sized to 256×256 pixels, but
-4 pixels of the original will represent 1 pixel in screen units.
+Mapbox支持所有提供图像的APIs上的Retina图像输出。
+在URL上的文件扩展名之前添加`@2x`,以双倍比例请求图像。
+例如, 一张带有`@2x`的256×256像素的地图瓦片将是
+512×512像素,但显示相同的内容。
+当在页面上显示时,图像的大小仍将为256×256像素,
+但原始的4个像素将以屏幕单元表示1个像素。
-The `@2x` part of the URL goes before the entire format, so a URL
-that ends in `.png` would end with `@2x.png` as a Retina image.
+URL的`@2x`部分先于整个格式,
+因此以`.png`结尾的URL将以`@2x.png`作为Retina图像的结尾。
-The only assets that are not available at Retina scale are tilesets
-uploaded from TileMill or as MBTiles.
+唯一不能在Retina比例上使用的资源是TileMill上传的tilesets
+或MBTiles。
## HTTPS
-We recommend all access to Mapbox is over HTTPS. Except for the
-Maps API, requests initiated over HTTP are automatically upgraded to HTTPS.
+我们推荐通过HTTPS来访问Mapbox。
+除Maps API外,通过HTTP启动的请求会自动升级为HTTPS。
## Pagination
@@ -154,34 +127,33 @@ Maps API, requests initiated over HTTP are automatically upgraded to HTTPS.
Link: ; rel="next"
```
-Pagination lets you list many objects from an API by using more than one
-request. After receiving a page of objects, the next page can be requested using
-the `next` link relation in [`Link` header](http://tools.ietf.org/html/rfc5988)
-of the response. This process can be repeated until the server sends a response
-without a `Link` header or without a `next` link relation, which signals the end
-of the collection.
+分页允许您使用多个请求从API列出许多对象。
+在接收到一页对象之后,
+可以使用响应的 [`Link` header](http://tools.ietf.org/html/rfc5988) 中的 `下一个` 链接关系来请求下一页。
+可以重复此过程,
+直到服务器发送没有`链接`头或没有`下一个`链接关系的响应,
+这表示集合的结束。
-Your application *must* use the `Link` header for pagination instead of
-constructing your own URLs as the specific URLs used for pagination may change
-at any time. The
+您的应用程序 *必须* 使用`链接`标头进行分页,
+而不是构建您自己的URLs,因为用于分页的特定URLs可能随时更改。
[Python requests library](http://docs.python-requests.org/en/master/user/advanced/#link-headers),
-and the
+和
[link-header-parser module for JavaScript](https://github.com/thlorenz/parse-link-header)
-can parse Link headers. Link headers follow the [RFC 5988 specifications](http://tools.ietf.org/html/rfc5988).
+能解析链接头。链接头符合 [RFC 5988 specifications](http://tools.ietf.org/html/rfc5988) 规范。
-Pagination is supported on the [Datasets](#datasets), [Uploads](#uploads), [Styles](#styles), [Tilesets](#tilesets), and [Tokens](#tokens) list endpoints.
+在[Datasets](#datasets), [Uploads](#uploads), [Styles](#styles), [Tilesets](#tilesets), 和 [Tokens](#tokens) 列表终端点上支持分页。
-| Query Parameter | Description |
+| 查询参数 | 说明 |
| --- | --- |
-| `limit` | The *maximum* number of objects to return. The API will attempt to return the requested number of objects, but receiving fewer objects does not necessarily signal the end of the collection. Receiving a response with no `Link` header or no `next` link relation is the only way to determine when you are at the end of a collection. |
+| `限制` | 要返回对象的*最大*数。API将尝试返回对象的请求数,但是接收更少的对象并不一定意味着集合的结束。接收没有`链接`头或没有`下一个`链接关系的响应是确定何时处于集合末尾的唯一方法。 |
## Dates
-Most dates and times returned by the API are represented
-in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, which can be
-parsed by the [JavaScript Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)
-constructor, the [Python arrow library](https://github.com/crsmithdev/arrow),
-and many other libraries and languages.
+API返回的大多数日期和时间都
+以[RFC 3339](https://tools.ietf.org/html/rfc3339) 格式表示,可以通过
+[JavaScript Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)
+构造函数,[Python arrow library](https://github.com/crsmithdev/arrow),
+以及许多其他库和语言进行解析。
```javascript
var parsedDate = new Date('2014-11-21T19:41:10.000Z');
@@ -215,8 +187,8 @@ rfc3339DateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
let date = rfc3339DateFormatter.date(from: "2014-11-21T19:41:10.000Z")
```
-The only exception to this rule is the [Retrieve TileJSON metadata](#retrieve-tilejson-metadata)
-endpoint that returns `created` and `modified` properties as [Unix time](https://en.wikipedia.org/wiki/Unix_time).
+此规则的唯一例外是 [Retrieve TileJSON metadata](#retrieve-tilejson-metadata)
+终端点,它将`创建`和`修改`的属性作为 [Unix time](https://en.wikipedia.org/wiki/Unix_time) 返回。
```objc
@import Foundation;
@@ -232,24 +204,24 @@ let date = Date(timeIntervalSince1970: 1_416_598_870_000)
## Coordinates
-Where geographic coordinates are provided to a Mapbox API, they should be formatted
-in the order `longitude, latitude` and specified as decimal degrees in the WGS84
-coordinate system. This pattern matches existing standards, including GeoJSON and KML.
+如果地理坐标提供给Mapbox API,
+则应按照`经度,纬度`的顺序对其进行格式化,并在WGS84坐标系中指定为十进制度。
+这种模式符合现有标准,包括GeoJSON和KML。
-Mapbox APIs use GeoJSON formatting wherever possible to represent
-geospatial data. The Directions, Map Matching, Geocoding, and Datasets APIs
-all return GeoJSON-formatted responses, and the Upload and Map Matching APIs
-accept GeoJSON input.
+Mapbox APIs use GeoJSON formatting wherever possible to represent Mapbox APIs尽可能使用GeoJSON格式来表示
+geospatial data. 地理空间数据。方向,地图匹配,地理编码和数据集APIs The Directions, Map Matching, Geocoding, and Datasets APIs
+都返回GeoJSON格式的响应,all return GeoJSON-formatted responses, and the Upload and Map Matching APIs
+accept GeoJSON input.上传和地图匹配APIs都接受GeoJSON输入。
-The only exception to `longitude, latitude` ordering is the polyline format, supported
-in Static (Classic) overlays and Directions responses. When polyline input
-or output is specified, the polyline content should follow the Google Encoded Polyline format,
-which specifies `latitude, longitude` ordering.
+唯一例外的`经度,纬度`顺序是多段线,
+在静态(经典)叠加和路线响应支持。 当指定多段线
+输入或输出时,多段线内容应遵循Google编码多段线格式,
+该格式指定`纬度,经度`顺序。
-The Mapbox Swift libraries use the Core Location framework’s
+Mapbox Swift库使用了核心位置框架的
[`CLLocationCoordinate2D`](https://developer.apple.com/reference/corelocation/cllocationcoordinate2d)
-type to represent geographic coordinates. When initializing a
-`CLLocationCoordinate2D`, always specify the latitude before the longitude.
+类型来表示地理坐标。初始化
+`CLLocationCoordinate2D`时,始终在经度之前指定纬度。
```objc
@import CoreLocation;
diff --git a/uploads.md b/uploads.md
index 495fc31..73680bc 100755
--- a/uploads.md
+++ b/uploads.md
@@ -1,35 +1,35 @@
## Uploads
-The Mapbox Uploads API transforms geographic data into tilesets that can be used with maps and geographic applications. Given a wide variety of geospatial formats, it normalizes projections and generates tiles at multiple zoom levels to make data viewable on the web.
+Mapbox Uploads API将地理数据转换为可与地图和地理应用一起使用的瓦片。鉴于各种地理空间格式,它对投影进行标准化并生成多种缩放等级的切片以便在网络上查看数据。
-The upload workflow follows these steps:
+上传工作流程遵循以下步骤:
-1. Request temporary S3 credentials that allow you to stage the file. _Jump to the [Retrieve S3 credentials section](#retrieve-s3-credentials)._
-1. Use an S3 client to upload the file to Mapbox's S3 staging bucket using these credentials. _Learn more about this process in the [Upload to Mapbox using cURL tutorial](https://www.mapbox.com/help/upload-curl/)._
-1. Create an upload using the staged file's URL. _Jump to the [Create an upload section](#create-an-upload)._
-1. Retrieve the upload's status as it is being processed into a tileset. _Jump to the [Retrieve upload status section](#retrieve-upload-status)._
+1. 请求允许您暂存文件的临时S3凭据。_跳转至 [取回S3凭据部分](#retrieve-s3-credentials) 。_
+1. 使用S3客户端通过这些凭据来上传文件至Mapbox的S3 staging bucket。_通过 [使用cURL教程上传至Mapbox](https://www.mapbox.com/help/upload-curl/) 了解此过程的更多信息。_
+1. 使用暂存文件的URL创建上传。_跳转至 [创建上传部分](#create-an-upload) 。_
+1. 在其正被处理为一个瓦片的同时检索上传的状态。_跳转至 [检索上传状态部分](#retrieve-upload-status) 。_
-**Note:** This documentation discusses how to interact with the Mapbox Uploads API programatically. For a step-by-step guide on how to use the Uploads API to stage a file to Amazon S3 and create an upload, use the [Upload to Mapbox using cURL tutorial](https://www.mapbox.com/help/upload-curl/).
+**注意:** 该文档讨论了如何以编程方式与Mapbox Uploads API进行交互。有关如何使用Uploads API将文件转存至Amazon S3并创建上载的分步指南,使用 [使用cURL教程上传至Mapbox](https://www.mapbox.com/help/upload-curl/)。
-**Restrictions and limits**
+**限制**
-- Tileset names are limited to 64 characters.
-- The Uploads API supports different file sizes for various file types:
+- 瓦片文件名限制为64个字符。
+- Uploads API支持各种文件类型的不同文件大小:
-File type | Size limit
+文件类型 | 大小限制
--- | ---
-TIFF and GeoTIFF | 10 GB
+TIFF 和 GeoTIFF | 10 GB
MBTiles | 25 GB
GeoJSON | 1 GB
CSV | 1 GB
KML | 260 MB
GPX | 260 MB
-Shapefile (zipped) | 260 MB
+Shapefile(压缩) | 260 MB
Mapbox Dataset | 1 GB
-**Error messages**
+**错误信息**
-To see a list of possible upload errors, visit the [Uploads errors page](https://www.mapbox.com/help/uploads/#errors).
+查看可能的上传错误列表,访问 [上传错误页面](https://www.mapbox.com/help/uploads/#errors) 。
```python
from mapbox import Uploader
@@ -46,15 +46,14 @@ const uploadsClient = mbxUploads({ accessToken: '{your_access_token}' });
POST /uploads/v1/{username}/credentials uploads:write
```
-Mapbox provides an Amazon S3 bucket to stage your file while your upload is processed. This endpoint allows you to retrieve temporary S3 credentials to use during the staging process.
+Mapbox提供了一个Amazon S3 bucket,用于在处理上传时暂存文件。此端点允许您检索临时S3凭据以在暂存过程中使用。
-**Note:** This step is necessary before you can stage a file in the Amazon S3 bucket provided by Mapbox. All uploads must be staged in this Amazon S3 bucket before being uploaded to your Mapbox account. To learn more about how to stage an upload to Amazon S3, read the [Upload to Mapbox using cURL tutorial](https://www.mapbox.com/help/upload-curl/#stage-your-file-on-amazon-s3).
+**注意:** 在您可以在Mapbox提供的Amazon S3 bucket中暂存文件之前,必须执行此步骤。所有上传必须在此Amazon S3 bucket中暂存,然后才能上传到您的Mapbox帐户。要了解有关如何上传到Amazon S3的更多信息,查阅 [使用cURL教程上传至Mapbox](https://www.mapbox.com/help/upload-curl/#stage-your-file-on-amazon-s3) 。
-URL parameters | Description
+URL 参数 | 描述
--- | ---
-`username` | The username of the account to which you are uploading a tileset.
-
-#### Example request
+`username` | 要上传瓦片的帐户的用户名。
+#### 请求示例
```curl
curl -X POST "https://api.mapbox.com/uploads/v1/{username}/credentials?access_token={your_access_token}"
@@ -96,22 +95,22 @@ with open('data.geojson', 'r') as src:
```
```bash
-# AWS cannot be accessed through Mapbox CLI
+# 无法通过Mapbox CLI访问AWS
```
```java
-// This API cannot be accessed with the Mapbox Java SDK
+// 无法使用Mapbox Java SDK访问此API
```
```objc
-// This API cannot be accessed with the Mapbox Objective-C libraries
+// 无法使用Mapbox Objective-C库访问此API
```
```swift
-// This API cannot be accessed with the Mapbox Swift libraries
+// 无法使用Mapbox Swift库访问此API
```
-#### Example response
+#### 响应示例
```json
{
@@ -124,22 +123,22 @@ with open('data.geojson', 'r') as src:
}
```
-**Response body**
+**响应主体**
-The response body is a JSON object that contains the following properties:
+响应主体是一个包含以下属性的JSON对象:
-Property | Description
+属性 | 描述
---- | -----------
-`accessKeyId` | AWS Access Key ID
-`bucket` | S3 bucket name
-`key` | The unique key for data to be staged
-`secretAccessKey` | AWS Secret Access Key
-`sessionToken` | A temporary security token
-`url` | The destination URL of the file
+`accessKeyId` | AWS访问密钥ID
+`bucket` | S3 bucket名称
+`key` | 要暂存数据的唯一键
+`secretAccessKey` | AWS秘密访问密钥
+`sessionToken` | 临时安全令牌
+`url` | 文件的目标URL
-Use these credentials to store your data in the provided bucket with the provided key using the [AWS CLI](http://docs.aws.amazon.com/cli/latest/reference/s3/index.html) or AWS SDK of your choice. The bucket is located in AWS region `us-east-1`.
+使用这些凭据通过 [AWS CLI](http://docs.aws.amazon.com/cli/latest/reference/s3/index.html) 将提供的密钥存储在提供的存储桶中或您选择AWS SDK。存储桶位于AWS区域 `us-east-1`.
-**Example AWS CLI usage**
+**AWS CLI使用示例**
```
$ export AWS_ACCESS_KEY_ID={accessKeyId}
@@ -154,27 +153,27 @@ $ aws s3 cp /path/to/file s3://{bucket}/{key} --region us-east-1
POST /uploads/v1/{username} uploads:write
```
-After you have used the temporary S3 credentials to transfer your file to Mapbox's staging bucket, you can trigger the generation of a tileset using the file's URL and a destination tileset ID.
+使用临时S3凭据将文件传输到Mapbox的临时存储桶后,可以使用文件的URL和目标瓦片ID触发瓦片的生成。
-Uploaded files _must_ be in the bucket provided by Mapbox. Requests for resources from other S3 buckets or URLs will fail.
+上传的文件_必须_位于Mapbox提供的存储桶中。来自其他S3存储桶或URL的资源请求将失败。
-URL parameters | Description
+URL参数 | 描述
--- | ---
-`username` | The username of the account to which you are uploading
+`username` | 您要上传的帐户的用户名
-**Request body**
+**请求主体**
-The request body must be a JSON object that contains the following properties:
+请求主体必须是包含以下属性的JSON对象:
-Property | Description
+属性 | 描述
---- | ------
-`tileset` | The map ID to create or replace, in the format `username.nameoftileset`. Limited to 32 characters. This character limit does not include the username. The only allowed special characters are `-` and `_`.
-`url` | The HTTPS URL of the S3 object provided in the credential request, or the [dataset ID](https://www.mapbox.com/help/define-dataset-id/) of an existing Mapbox dataset to be uploaded.
-`name`
(optional) | The name of the tileset. Limited to 64 characters.
+`tileset` | 要创建或替换的地图ID,格式`username.nameoftileset`。限制为32个字符。此字符限制不包括用户名。 唯一允许的特殊字符是`-`和`_`。
+`url` | 凭据请求中提供的S3对象的HTTPS URL,或要上载的现有Mapbox数据集的[数据集ID](https://www.mapbox.com/help/define-dataset-id/)。
+`name`
(可选) | 瓦片文件名。限制为64个字符。
-If you reuse a `tileset` value, this action will replace existing data. Use a random value to make sure that a new tileset is created, or check your existing tilesets first.
+如果重复使用`tileset`值,此操作将替换现有数据。使用随机值确保创建新的瓦片,或首先检查现有的瓦片。
-#### Example request
+#### 请求示例
```curl
curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
@@ -184,7 +183,7 @@ curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d
```
```javascript
-// Response from a call to createUploadCredentials
+// 调用createUploadCredentials的响应
const credentials = {
accessKeyId: '{accessKeyId}',
bucket: '{bucket}',
@@ -207,8 +206,8 @@ uploadsClient
```python
with open('data.geojson', 'r') as src:
- # Acquisition of credentials, staging of data, and upload
- # finalization is done by a single method in the Python SDK.
+ # 获取凭证,暂存数据和上传
+ # 最终化由Python SDK中的单个方法完成。
upload_resp = service.upload(src, '{username}.data')
```
@@ -217,18 +216,18 @@ mapbox upload username.data data.geojson
```
```java
-// This API cannot be accessed with the Mapbox Java SDK
+// 无法使用Mapbox Java SDK访问此API
```
```objc
-// This API cannot be accessed with the Mapbox Objective-C libraries
+// 无法使用Mapbox Objective-C库访问此API
```
```swift
-// This API cannot be accessed with the Mapbox Swift libraries
+// 无法使用Mapbox Swift库访问此API
```
-#### Example request body to upload a Mapbox dataset (AWS S3 bucket not required)
+#### 上传Mapbox数据集的请求示例正文(不需要AWS S3存储桶)
```json
{
@@ -238,7 +237,7 @@ mapbox upload username.data data.geojson
}
```
-#### Example response
+#### 响应示例
```json
{