# @allmaps/stdlib 中文文档

规范地址：https://npmcn.com/package/%40allmaps/stdlib/

版本：1\.0\.0-beta\.42
npm 元数据更新时间：2026-10-01T09:24:37.602Z
中文译文更新时间：2026-11-05T22:36:11.330Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40allmaps/stdlib
原文对照：https://npmcn.com/package/%40allmaps/stdlib/?lang=original
项目主页：https://allmaps.org/
源码仓库：https://github.com/allmaps/allmaps

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：147 kB，35 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- 运行依赖：10 个
- 首次发布：2023-02-16T10:41:06.886Z
- 最新版本发布：2026-09-22T07:06:48.247Z
- 近 30 天下载量：11705（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：36（近 12 个月 5 个）

## 中文简介

全部地图标准库

## 安装

```sh
npm install @allmaps/stdlib
```

也可以使用：`pnpm add @allmaps/stdlib`、`yarn add @allmaps/stdlib`、`bun add @allmaps/stdlib`

## README

# @allmaps/stdlib (英语)

全部地图标准库

## 许可证

麻省理工学院

## API 密码

### `new ResourceFetchError(kind, input, options)`

###### 参数

-   `kind` (单位:千美元)`'http' | 'network-or-cors'`(中文(简体) )
-   `input` (单位:千美元)`URL | RequestInfo`(中文(简体) )
-   `options` (单位:千美元)`ResourceFetchErrorOptions | undefined`(中文(简体) )

###### 回返

`ResourceFetchError`。 。 。 .

###### 扩展

-   `Error`

### `ResourceFetchError#cause?`

###### 类型

```ts
unknown
```

### `ResourceFetchError#corsLikely`

###### 类型

```ts
boolean
```

### `ResourceFetchError#input`

###### 类型

```ts
URL | RequestInfo
```

### `ResourceFetchError#kind`

###### 类型

```ts
'http' | 'network-or-cors'
```

### `ResourceFetchError#status?`

###### 类型

```ts
number
```

### `ResourceFetchError#statusText?`

###### 类型

```ts
string
```

### `ResourceFetchError#url`

###### 类型

```ts
string
```

### `ResourceFetchErrorKind`

###### 类型

```ts
'http' | 'network-or-cors'
```

### `angle(line)`

###### 参数

-   `line` (单位:千美元)`[Point, Point]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `angularMean(angles)`

###### 参数

-   `angles` (单位:千美元)`number`(中文(简体) )

###### 回返

`number`。 。 。 .

### `arrayContains(array, object, isEqualObject)`

###### 参数

-   `array` (单位:千美元)`Array<T>`(中文(简体) )
-   `object` (单位:千美元)`T`(中文(简体) )
-   `isEqualObject` (单位:千美元)`((t0: T, t1: T) => boolean) | undefined`(中文(简体) )

###### 回返

`{item: T; index: number} | undefined`。 。 。 .

### `arrayDifference(array0, array1, isEqualObject)`

###### 参数

-   `array0` (单位:千美元)`Array<T>`(中文(简体) )
-   `array1` (单位:千美元)`Array<T>`(中文(简体) )
-   `isEqualObject` (单位:千美元)`((t0: T, t1: T) => boolean) | undefined`(中文(简体) )

###### 回返

`Array<T>`。 。 。 .

### `arrayMatrixSize(arrayMatrix)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `arrayRepeated(array, isEqualObject)`

###### 参数

-   `array` (单位:千美元)`Array<T>`(中文(简体) )
-   `isEqualObject` (单位:千美元)`((t0: T, t1: T) => boolean) | undefined`(中文(简体) )

###### 回返

`Array<{item: T; index: number}>`。 。 。 .

### `arrayUnique(array, isEqualObject)`

###### 参数

-   `array` (单位:千美元)`Array<T>`(中文(简体) )
-   `isEqualObject` (单位:千美元)`((t0: T, t1: T) => boolean) | undefined`(中文(简体) )

###### 回返

`Array<T>`。 。 。 .

### `bboxToCenter(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `bboxToDiameter(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `bboxToLine(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`[Point, Point]`。 。 。 .

### `bboxToPolygon(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `bboxToRectangle(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`[Point, Point, Point, Point]`。 。 。 .

### `bboxToResolution(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `bboxToSize(bbox)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `bboxesToScale(bbox0, bbox1, fit)`

###### 参数

-   `bbox0` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `bbox1` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `fit?` (单位:千美元)`Fit | undefined`(中文(简体) )

###### 回返

`number`。 。 。 .

### `bufferBbox(bbox, dist0, dist1)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `dist0` (单位:千美元)`number`(中文(简体) )
-   `dist1?` (单位:千美元)`number | undefined`(中文(简体) )

###### 回返

`[number, number, number, number]`。 。 。 .

### `bufferBboxByRatio(bbox, ratio)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `ratio?` (单位:千美元)`number | undefined`(中文(简体) )

###### 回返

`[number, number, number, number]`。 。 。 .

### `camelCaseToWords(string)`

###### 参数

-   `string` (单位:千美元)`string`(中文(简体) )

###### 回返

`string`。 。 。 .

### `clipPoint(point, min, max)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `min` (单位:千美元)`[number, number]`(中文(简体) )
-   `max` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `clipPointLngLatProjection(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `clipPointWebMercatorProjection(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `clipValue(value, min, max)`

###### 参数

-   `value` (单位:千美元)`number`(中文(简体) )
-   `min` (单位:千美元)`number`(中文(简体) )
-   `max` (单位:千美元)`number`(中文(简体) )

###### 回返

`number`。 。 。 .

### `closeMultiPolygon(multiPolygon)`

###### 参数

-   `multiPolygon` (单位:千美元)`Array<Array<Array<Point>>>`(中文(简体) )

###### 回返

`Array<Array<Array<Point>>>`。 。 。 .

### `closePolygon(polygon)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `closeRing(ring)`

###### 参数

-   `ring` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `combineBboxes(bboxes)`

###### 参数

-   `bboxes` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`Bbox | undefined`。 。 。 .

### `computeBbox(geometry)`

###### 参数

-   `geometry` (单位:千美元)`GeojsonGeometry | Geometry`(中文(简体) )

###### 回返

`[number, number, number, number]`。 。 。 .

### `computeMinMax(values)`

###### 参数

-   `values` (单位:千美元)`Array<number>`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `computeRotatedBboxProperties(geometry, angle)`

###### 参数

-   `geometry` (单位:千美元)`GeojsonGeometry | Geometry`(中文(简体) )
-   `angle` (单位:千美元)`number`(中文(简体) )

###### 回返

`{ center: Point size: Size bbox: Bbox rectangle: Rectangle rotatedRectangle: Rectangle }`。 。 。 .

### `conformLineString(lineString)`

###### 参数

-   `lineString` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `conformMultiLineString(multiLineString)`

###### 参数

-   `multiLineString` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `conformMultiPolygon(multiPolygon)`

###### 参数

-   `multiPolygon` (单位:千美元)`Array<Array<Array<Point>>>`(中文(简体) )

###### 回返

`Array<Array<Array<Point>>>`。 。 。 .

### `conformPolygon(polygon)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `conformRing(ring)`

###### 参数

-   `ring` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `contractGeojsonGeometriesToGeojsonMultiGeometry(geojsonGeometries)`

###### 参数

-   `geojsonGeometries` (单位:千美元)`Array<GeojsonLineString | GeojsonPoint | GeojsonPolygon>`(中文(简体) )

###### 回返

`GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon`。 。 。 .

### `contractGeojsonLineStringsToGeojsonMultiLineString(geojsonLineStrings)`

###### 参数

-   `geojsonLineStrings` (单位:千美元)`Array<GeojsonLineString>`(中文(简体) )

###### 回返

`{type: 'MultiLineString'; coordinates: number[][][]}`。 。 。 .

### `contractGeojsonPointsToGeojsonMultiPoint(geojsonPoints)`

###### 参数

-   `geojsonPoints` (单位:千美元)`Array<GeojsonPoint>`(中文(简体) )

###### 回返

`{type: 'MultiPoint'; coordinates: number[][]}`。 。 。 .

### `contractGeojsonPolygonsToGeojsonMultiPolygon(geojsonPolygons)`

###### 参数

-   `geojsonPolygons` (单位:千美元)`Array<GeojsonPolygon>`(中文(简体) )

###### 回返

`{type: 'MultiPolygon'; coordinates: number[][][][]}`。 。 。 .

### `convexHull(points)`

###### 参数

-   `points` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Ring | undefined`。 。 。 .

### `degreesToRadians(degrees)`

###### 参数

-   `degrees` (单位:千美元)`number`(中文(简体) )

###### 回返

`number`。 。 。 .

### `distance(from, to)`

###### 参数

-   `from` (单位:千美元)`[number, number]`(中文(简体) )
-   `to` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `doBboxesIntersect(bbox0, bbox1)`

###### 参数

-   `bbox0` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `bbox1` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `equalSet(set1, set2)`

###### 参数

-   `set1` (单位:千美元)`Set<T> | null`(中文(简体) )
-   `set2` (单位:千美元)`Set<T> | null`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `expandGeojsonMultiGeometryToGeojsonGeometries(geojsonMultiGeometry)`

###### 参数

-   `geojsonMultiGeometry` (单位:千美元)`GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon`(中文(简体) )

###### 回返

`Array<GeojsonLineString> | Array<GeojsonPoint> | Array<GeojsonPolygon>`。 。 。 .

### `expandGeojsonMultiLineStringToGeojsonLineStrings(geojsonMultiLineString)`

###### 参数

-   `geojsonMultiLineString` (单位:千美元)`{type: 'MultiLineString'; coordinates: number[][][]}`(中文(简体) )

###### 回返

`Array<GeojsonLineString>`。 。 。 .

### `expandGeojsonMultiPointToGeojsonPoints(geojsonMultiPoint)`

###### 参数

-   `geojsonMultiPoint` (单位:千美元)`{type: 'MultiPoint'; coordinates: number[][]}`(中文(简体) )

###### 回返

`Array<GeojsonPoint>`。 。 。 .

### `expandGeojsonMultiPolygonToGeojsonPolygons(geojsonMultiPolygon)`

###### 参数

-   `geojsonMultiPolygon` (单位:千美元)`{type: 'MultiPolygon'; coordinates: number[][][][]}`(中文(简体) )

###### 回返

`Array<GeojsonPolygon>`。 。 。 .

### `fetchAnnotationsFromApi(restBaseUrl, parsedIiif, fetch)`

###### 参数

-   `restBaseUrl` (单位:千美元)`string`(中文(简体) )
-   `parsedIiif` (单位:千美元)`Collection | Image | Manifest`(中文(简体) )
-   `fetch?` (单位:千美元) `| ((input: RequestInfo | URL, init?: RequestInit) => Promise<Response>) | undefined`(中文(简体) )

###### 回返

`Promise<any>`。 。 。 .

### `fetchImageBitmap(input, init, fetchFn)`

###### 参数

-   `input` (单位:千美元)`URL | RequestInfo`(中文(简体) )
-   `init?` (单位:千美元)`RequestInit | undefined`(中文(简体) )
-   `fetchFn?` (单位:千美元)`FetchFn | undefined`(中文(简体) )

###### 回返

`Promise<ImageBitmap>`。 。 。 .

### `fetchImageInfo(imageUri, init, fetchFn)`

###### 参数

-   `imageUri` (单位:千美元)`string`(中文(简体) )
-   `init?` (单位:千美元)`RequestInit | undefined`(中文(简体) )
-   `fetchFn?` (单位:千美元)`FetchFn | undefined`(中文(简体) )

###### 回返

`Promise<unknown>`。 。 。 .

### `fetchJson(input, init, fetchFn)`

###### 参数

-   `input` (单位:千美元)`URL | RequestInfo`(中文(简体) )
-   `init?` (单位:千美元)`RequestInit | undefined`(中文(简体) )
-   `fetchFn?` (单位:千美元)`FetchFn | undefined`(中文(简体) )

###### 回返

`Promise<unknown>`。 。 。 .

### `fetchUrl(input, init, fetchFn)`

###### 参数

-   `input` (单位:千美元)`URL | RequestInfo`(中文(简体) )
-   `init?` (单位:千美元)`RequestInit | undefined`(中文(简体) )
-   `fetchFn?` (单位:千美元)`FetchFn | undefined`(中文(简体) )

###### 回返

`Promise<Response>`。 。 。 .

### `flipX(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `flipY(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `geojsonFeatureCollectionToGeojsonGeometries(geojsonFeatureCollection)`

###### 参数

-   `geojsonFeatureCollection` (单位:千美元)`{type: 'FeatureCollection'; features: GeojsonFeature[]}`(中文(简体) )

###### 回返

`Array<GeojsonGeometry>`。 。 。 .

### `geojsonFeatureToGeojsonGeometry(geojsonFeature)`

###### 参数

-   `geojsonFeature` (单位:千美元)`{type: 'Feature'; properties: unknown; geometry: GeojsonGeometry}`(中文(简体) )

###### 回返

`| GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon`。 。 。 .

### `geojsonFeaturesToGeojsonFeatureCollection(geojsonFeatures)`

###### 参数

-   `geojsonFeatures` (单位:千美元)`Array<GeojsonFeature> | GeojsonFeature`(中文(简体) )

###### 回返

`{type: 'FeatureCollection'; features: GeojsonFeature[]}`。 。 。 .

### `geojsonGeometriesToGeojsonFeatureCollection(geojsonGeometries, properties)`

###### 参数

-   `geojsonGeometries` (单位:千美元)`Array<GeojsonGeometry>`(中文(简体) )
-   `properties?` (单位:千美元)`Array<unknown> | undefined`(中文(简体) )

###### 回返

`{type: 'FeatureCollection'; features: GeojsonFeature[]}`。 。 。 .

### `geojsonGeometryToGeojsonFeature(geojsonGeometry, properties)`

###### 参数

-   `geojsonGeometry` (单位:千美元) `| GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon`(中文(简体) )
-   `properties?` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`{type: 'Feature'; properties: unknown; geometry: GeojsonGeometry}`。 。 。 .

### `geojsonGeometryToGeometry(geojsonPoint)`

###### 参数

-   `geojsonPoint` (单位:千美元)`{type: 'Point'; coordinates: number[]}`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `geojsonGeometryToSvgGeometry(geojsonGeometry)`

###### 参数

-   `geojsonGeometry` (单位:千美元) `| GeojsonLineString | GeojsonMultiLineString | GeojsonMultiPoint | GeojsonMultiPolygon | GeojsonPoint | GeojsonPolygon`(中文(简体) )

###### 回返

`SvgCircle | SvgLine | SvgPolyLine | SvgPolygon | SvgRect`。 。 。 .

### `geojsonLineStringToLineString(geojsonLineString)`

###### 参数

-   `geojsonLineString` (单位:千美元)`{type: 'LineString'; coordinates: number[][]}`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `geojsonMultiLineStringToMultiLineString(geojsonMultiLineString)`

###### 参数

-   `geojsonMultiLineString` (单位:千美元)`{type: 'MultiLineString'; coordinates: number[][][]}`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `geojsonMultiPointToMultiPoint(geojsonMultiPoint)`

###### 参数

-   `geojsonMultiPoint` (单位:千美元)`{type: 'MultiPoint'; coordinates: number[][]}`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `geojsonMultiPolygonToMultiPolygon(geojsonMultiPolygon, close)`

###### 参数

-   `geojsonMultiPolygon` (单位:千美元)`{type: 'MultiPolygon'; coordinates: number[][][][]}`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`Array<Array<Array<Point>>>`。 。 。 .

### `geojsonPointToPoint(geojsonPoint)`

###### 参数

-   `geojsonPoint` (单位:千美元)`{type: 'Point'; coordinates: number[]}`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `geojsonPolygonToPolygon(geojsonPolygon, close)`

###### 参数

-   `geojsonPolygon` (单位:千美元)`{type: 'Polygon'; coordinates: number[][][]}`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `geojsonPolygonToRing(geojsonPolygon, close)`

###### 参数

-   `geojsonPolygon` (单位:千美元)`{type: 'Polygon'; coordinates: number[][][]}`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `geometryToDiameter(geometry)`

###### 参数

-   `geometry` (单位:千美元)`GeojsonGeometry | Geometry`(中文(简体) )

###### 回返

`number`。 。 。 .

### `geometryToGeojsonGeometry(point, options)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `options?` (单位:千美元)`Partial<MultiGeometryOptions> | undefined`(中文(简体) )

###### 回返

`{type: 'Point'; coordinates: number[]}`。 。 。 .

### `geometryToSvgGeometry(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`{type: 'circle'; attributes?: SvgAttributes; coordinates: Point}`。 。 。 .

### `getFullResourceMask(imageWidth, imageHeight)`

###### 参数

-   `imageWidth` (单位:千美元)`number`(中文(简体) )
-   `imageHeight` (单位:千美元)`number`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `getPropertyFromCacheOrComputation(cache, key, computation, checkUse, checkStore)`

###### 参数

-   `cache` (单位:千美元)`Map<K, T>`(中文(简体) )
-   `key` (单位:千美元)`K`(中文(简体) )
-   `computation` (单位:千美元)`() => T`(中文(简体) )
-   `checkUse` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )
-   `checkStore` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )

###### 回返

`T`。 。 。 .

### `getPropertyFromDoubleCacheOrComputation(cache, key0, key1, computation, checkUse, checkStore)`

###### 参数

-   `cache` (单位:千美元)`Map<K0, Map<K1, T>>`(中文(简体) )
-   `key0` (单位:千美元)`K0`(中文(简体) )
-   `key1` (单位:千美元)`K1`(中文(简体) )
-   `computation` (单位:千美元)`() => T`(中文(简体) )
-   `checkUse` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )
-   `checkStore` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )

###### 回返

`T`。 。 。 .

### `getPropertyFromQuadrupleCacheOrComputation(cache, key0, key1, key2, key3, computation, checkUse, checkStore)`

###### 参数

-   `cache` (单位:千美元)`Map<K0, Map<K1, Map<K2, Map<K3, T>>>>`(中文(简体) )
-   `key0` (单位:千美元)`K0`(中文(简体) )
-   `key1` (单位:千美元)`K1`(中文(简体) )
-   `key2` (单位:千美元)`K2`(中文(简体) )
-   `key3` (单位:千美元)`K3`(中文(简体) )
-   `computation` (单位:千美元)`() => T`(中文(简体) )
-   `checkUse` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )
-   `checkStore` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )

###### 回返

`T`。 。 。 .

### `getPropertyFromQuintupleCacheOrComputation(cache, key0, key1, key2, key3, key4, computation, checkUse, checkStore)`

###### 参数

-   `cache` (单位:千美元)`Map<K0, Map<K1, Map<K2, Map<K3, Map<K4, T>>>>>`(中文(简体) )
-   `key0` (单位:千美元)`K0`(中文(简体) )
-   `key1` (单位:千美元)`K1`(中文(简体) )
-   `key2` (单位:千美元)`K2`(中文(简体) )
-   `key3` (单位:千美元)`K3`(中文(简体) )
-   `key4` (单位:千美元)`K4`(中文(简体) )
-   `computation` (单位:千美元)`() => T`(中文(简体) )
-   `checkUse` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )
-   `checkStore` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )

###### 回返

`T`。 。 。 .

### `getPropertyFromTripleCacheOrComputation(cache, key0, key1, key2, computation, checkUse, checkStore)`

###### 参数

-   `cache` (单位:千美元)`Map<K0, Map<K1, Map<K2, T>>>`(中文(简体) )
-   `key0` (单位:千美元)`K0`(中文(简体) )
-   `key1` (单位:千美元)`K1`(中文(简体) )
-   `key2` (单位:千美元)`K2`(中文(简体) )
-   `computation` (单位:千美元)`() => T`(中文(简体) )
-   `checkUse` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )
-   `checkStore` (单位:千美元)`((t: T) => boolean) | undefined`(中文(简体) )

###### 回返

`T`。 。 。 .

### `groupBy(arr, key)`

###### 参数

-   `arr` (单位:千美元)`Array<T>`(中文(简体) )
-   `key` (单位:千美元)`(i: T) => K`(中文(简体) )

###### 回返

`{[P in K]: Array<T>}`。 。 。 .

### `hexToFractionalOpaqueRgba(hex)`

将十六进制转换为分数 RGBA, 并将透明度设置为 1

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   十六进制字符串, 如“ # 0033ffcc ”

###### 回返

小数RGB,e(`[number, number, number, number]`.g. \[0, 0.2, 1, 1\] (中文(简体) )

### `hexToFractionalRgb(hex)`

将十六进制转换为分数 RGB

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   十六进制字符串, 如“ # 0033ff ”

###### 回返

小数RGB,e(`[number, number, number]`. g. \[0, 0.2, 1\] (中文(简体) )

### `hexToFractionalRgba(hex)`

将十六进制转换为分数 RGBA

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   十六进制字符串, 如“ # 0033ff ”

###### 回返

小数RGB,e(`[number, number, number, number]`.g. \[0, 0.2, 1, 1\] (中文(简体) )

### `hexToOpaqueRgba(hex)`

将 HEX 转换为 RGB, 并将透明度设置为 255

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   HEX 字符串, 例如 '# 0033ffcc'

###### 回返

RGB, e (中文(简体) )`[number, number, number, number]`.g. \[0、51、255、255\] (中文(简体) )

### `hexToRgb(hex)`

将 HEX 转换为 RGB

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   HEX 字符串, 例如 '# 0033ff'

###### 回返

RGB, e (中文(简体) )`[number, number, number]`. g. \[0, 51, 255\] (中文(简体) )

### `hexToRgba(hex)`

将 HEX 转换为 RGB

###### 参数

-   `hex` (单位:千美元)`string`(中文(简体) )
    -   HEX 字符串, 例如 '# 0033ffff'

###### 回返

RGB, e (中文(简体) )`[number, number, number, number]`.g. \[0、51、255、255\] (中文(简体) )

### `intersectBboxes(bbox0, bbox1)`

###### 参数

-   `bbox0` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `bbox1` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`Bbox | undefined`。 。 。 .

### `invertPoint(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `invertPoints(points)`

###### 参数

-   `points` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `isClosed(input)`

###### 参数

-   `input` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isEqualArray(array0, array1, isEqualObject)`

###### 参数

-   `array0` (单位:千美元)`Array<T>`(中文(简体) )
-   `array1` (单位:千美元)`Array<T>`(中文(简体) )
-   `isEqualObject` (单位:千美元)`((t0: T, t1: T) => boolean) | undefined`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isEqualPoint(point0, point1)`

###### 参数

-   `point0` (单位:千美元)`[number, number]`(中文(简体) )
-   `point1` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isEqualPointArray(pointArray0, pointArray1)`

###### 参数

-   `pointArray0` (单位:千美元)`Array<Point>`(中文(简体) )
-   `pointArray1` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isEqualPointArrayArray(pointArrayArray0, pointArrayArray1)`

###### 参数

-   `pointArrayArray0` (单位:千美元)`Array<Array<Point>>`(中文(简体) )
-   `pointArrayArray1` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonGeometry(obj)`

###### 参数

-   `obj` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonLineString(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonMultiGeometry(obj)`

###### 参数

-   `obj` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonMultiLineString(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonMultiPoint(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonMultiPolygon(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonPoint(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeojsonPolygon(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isGeometry(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isLineString(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isMultiLineString(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isMultiPoint(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isMultiPolygon(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isPoint(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isPolygon(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isRing(input)`

###### 参数

-   `input` (单位:千美元)`unknown`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isSvgCircle(input)`

###### 参数

-   `input` (单位:千美元)`any`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isSvgLine(input)`

###### 参数

-   `input` (单位:千美元)`any`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isSvgPolyLine(input)`

###### 参数

-   `input` (单位:千美元)`any`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isSvgPolygon(input)`

###### 参数

-   `input` (单位:千美元)`any`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isSvgRect(input)`

###### 参数

-   `input` (单位:千美元)`any`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `isValidHttpUrl(string)`

###### 参数

-   `string` (单位:千美元)`string`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `lineAngle(line)`

###### 参数

-   `line` (单位:千美元)`[Point, Point]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `lineStringToGeojsonLineString(lineString)`

###### 参数

-   `lineString` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`{type: 'LineString'; coordinates: number[][]}`。 。 。 .

### `lineStringToLines(lineString)`

###### 参数

-   `lineString` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Line>`。 。 。 .

### `linesIntersectionPoint(line0, line1, options)`

###### 参数

-   `line0` (单位:千美元)`[Point, Point]`(中文(简体) )
-   `line1` (单位:千美元)`[Point, Point]`(中文(简体) )
-   `options?` (单位:千美元)`Partial<IntersectionOptions> | undefined`(中文(简体) )

###### 回返

`Point | undefined`。 。 。 .

### `mapToResourceMaskSvgPolygon(map)`

###### 参数

-   `map` (单位:千美元)`{ '@context'?: "https://schemas.allmaps.org/map/2/context.json" | undefined; type: "GeoreferencedMap"; id?: string | undefined; created?: string | undefined; modified?: string | undefined; ... 5 more ...; _allmaps?: unknown; }`(中文(简体) )

###### 回返

`{type: 'polygon'; attributes?: SvgAttributes; coordinates: Ring}`。 。 。 .

### `mergeGeojsonFeaturesCollections(geojsonFeatureCollections)`

###### 参数

-   `geojsonFeatureCollections` (单位:千美元)`Array<GeojsonFeatureCollection>`(中文(简体) )

###### 回返

`{type: 'FeatureCollection'; features: GeojsonFeature[]}`。 。 。 .

### `mergeOptions(baseOptions, additionalPartialOptions)`

###### 参数

-   `baseOptions` (单位:千美元)`T`(中文(简体) )
-   `additionalPartialOptions` (单位:千美元)`U[0]`(中文(简体) )

###### 回返

`T & U[number]`。 。 。 .

### `mergeOptionsUnlessUndefined(baseOptions, additionalOptions)`

###### 参数

-   `baseOptions` (单位:千美元)`T`(中文(简体) )
-   `additionalOptions` (单位:千美元)`Partial<U> | undefined`(中文(简体) )

###### 回返

`T & Partial<U>`。 。 。 .

### `mergePartialOptions(partialOptions)`

###### 参数

-   `partialOptions` (单位:千美元)`U[0]`(中文(简体) )

###### 回返

`{[P in keyof U[number]]?: U[number][P] | undefined}`。 。 。 .

### `mergeTwoOptionsUnlessUndefined(baseOptions, additionalOption)`

###### 参数

-   `baseOptions` (单位:千美元)`T`(中文(简体) )
-   `additionalOption` (单位:千美元)`Partial<U> | undefined`(中文(简体) )

###### 回返

`T & Partial<U>`。 。 。 .

### `midPoint(points)`

###### 参数

-   `points` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `mixLineStrings(lineString0, lineString1, t)`

###### 参数

-   `lineString0` (单位:千美元)`Array<Point>`(中文(简体) )
-   `lineString1` (单位:千美元)`Array<Point>`(中文(简体) )
-   `t` (单位:千美元)`number`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `mixNumbers(number0, number1, t)`

###### 参数

-   `number0` (单位:千美元)`number`(中文(简体) )
-   `number1` (单位:千美元)`number`(中文(简体) )
-   `t` (单位:千美元)`number`(中文(简体) )

###### 回返

`number`。 。 。 .

### `mixPoints(point0, point1, t)`

###### 参数

-   `point0` (单位:千美元)`[number, number]`(中文(简体) )
-   `point1` (单位:千美元)`[number, number]`(中文(简体) )
-   `t` (单位:千美元)`number`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `multiLineStringToGeojsonMultiLineString(multiLineString)`

###### 参数

-   `multiLineString` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`{type: 'MultiLineString'; coordinates: number[][][]}`。 。 。 .

### `multiPointToGeojsonMultiPoint(multiPoint)`

###### 参数

-   `multiPoint` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`{type: 'MultiPoint'; coordinates: number[][]}`。 。 。 .

### `multiPolygonToGeojsonMultiPolygon(multiPolygon, close)`

###### 参数

-   `multiPolygon` (单位:千美元)`Array<Array<Array<Point>>>`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`{type: 'MultiPolygon'; coordinates: number[][][][]}`。 。 。 .

### `multiplyArrayMatrix(arrayMatrix, factor)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<number>>`(中文(简体) )
-   `factor` (单位:千美元)`number`(中文(简体) )

###### 回返

`Array<Array<number>>`。 。 。 .

### `newArrayMatrix(rows, cols, value)`

创建并填充 ArrayMatrix : 一组矩阵, 日后可以装入为 ml- matrix 矩阵

###### 参数

-   `rows` (单位:千美元)`number`(中文(简体) )
-   `cols` (单位:千美元)`number`(中文(简体) )
-   `value` (单位:千美元)`T | undefined`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `newBlockArrayMatrix(blocks, emptyValue)`

###### 参数

-   `blocks` (单位:千美元)`Array<Array<Array<Array<T>>>>`(中文(简体) )
-   `emptyValue` (单位:千美元)`T | undefined`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `objectDifference(newObject, baseObject, objectKeysPossiblyChanged)`

###### 参数

-   `newObject` (单位:千美元)`object`(中文(简体) )
-   `baseObject` (单位:千美元)`object`(中文(简体) )
-   `objectKeysPossiblyChanged?` (单位:千美元)`Array<string> | undefined`(中文(简体) )

###### 回返

`object`。 。 。 .

### `omit(object, keys)`

###### 参数

-   `object` (单位:千美元)`T`(中文(简体) )
-   `keys` (单位:千美元)`Array<K>`(中文(简体) )

###### 回返

`{[P in Exclude<keyof T, K>]: T[P]}`。 。 。 .

### `optionKeysByMapIdToUndefinedOptionsByMapId(optionKeysByMapId)`

###### 参数

-   `optionKeysByMapId` (单位:千美元)`Map<string, T> | undefined`(中文(简体) )

###### 回返

`Map<string, Record<T[number], undefined>> | undefined`。 。 。 .

### `optionKeysToUndefinedOptions(optionKeys)`

###### 参数

-   `optionKeys` (单位:千美元)`T | undefined`(中文(简体) )

###### 回返

`Record<T[number], undefined> | undefined`。 。 。 .

### `pasteArrayMatrix(arrayMatrix, rowsStart, colsStart, subArrayMatrix)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )
-   `rowsStart` (单位:千美元)`number`(中文(简体) )
-   `colsStart` (单位:千美元)`number`(中文(简体) )
-   `subArrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `pasteArrayMatrixInPlace(arrayMatrix, rowsStart, colsStart, subArrayMatrix)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )
-   `rowsStart` (单位:千美元)`number`(中文(简体) )
-   `colsStart` (单位:千美元)`number`(中文(简体) )
-   `subArrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `pixelToIntArrayIndex(pixel, size, channels, flipY)`

###### 参数

-   `pixel` (单位:千美元)`[number, number]`(中文(简体) )
-   `size` (单位:千美元)`[number, number]`(中文(简体) )
-   `channels` (单位:千美元)`number`(中文(简体) )
-   `flipY` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`number`。 。 。 .

### `pointInBbox(point, bbox)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `pointToGeojsonPoint(point)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`{type: 'Point'; coordinates: number[]}`。 。 。 .

### `pointToPixel(point, translate)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `translate` (单位:千美元)`Point | undefined`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `pointsAndPointsToLines(points0, points1)`

###### 参数

-   `points0` (单位:千美元)`Array<Point>`(中文(简体) )
-   `points1` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Line>`。 。 。 .

### `polygonIsBboxRectangle(polygon)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `polygonSelfIntersectionPoints(polygon, options)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )
-   `options?` (单位:千美元)`Partial<IntersectionOptions> | undefined`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `polygonToGeojsonPolygon(polygon, close)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`{type: 'Polygon'; coordinates: number[][][]}`。 。 。 .

### `prolongedLinesIntersectionPoint(line0, line1)`

###### 参数

-   `line0` (单位:千美元)`[Point, Point]`(中文(简体) )
-   `line1` (单位:千美元)`[Point, Point]`(中文(简体) )

###### 回返

`Point | undefined`。 。 。 .

### `radiansToDegrees(radians)`

###### 参数

-   `radians` (单位:千美元)`number`(中文(简体) )

###### 回返

`number`。 。 。 .

### `rectangleToSize(rectangle)`

###### 参数

-   `rectangle` (单位:千美元)`[Point, Point, Point, Point]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `rectanglesToScale(rectangle0, rectangle1, fit)`

###### 参数

-   `rectangle0` (单位:千美元)`[Point, Point, Point, Point]`(中文(简体) )
-   `rectangle1` (单位:千美元)`[Point, Point, Point, Point]`(中文(简体) )
-   `fit?` (单位:千美元)`Fit | undefined`(中文(简体) )

###### 回返

`number`。 。 。 .

### `removeUndefinedOptions(optionsArray)`

###### 参数

-   `optionsArray` (单位:千美元)`U[0]`(中文(简体) )

###### 回返

`{ [P in keyof {[K in keyof U[number]]: Exclude<U[number][K], undefined>}]?: {[K in keyof U[number]]: Exclude<U[number][K], undefined>}[P] | undefined }`。 。 。 .

### `rgbToHex(rgb)`

将 RBG 转换为 HEX

###### 参数

-   `rgb` (单位:千美元)`[number, number, number]`(中文(简体) )
    -   RGB 色彩阵列, 例如 \[0, 51, 255\]

###### 回返

HEX 字符串, e (`string`. g. '#0033ff' (中文(简体) )

### `rgbaToHex(rgba)`

将 RBGA 转换为 HEX

###### 参数

-   `rgba` (单位:千美元)`[number, number, number, number]`(中文(简体) )

###### 回返

HEX 字符串, e (`string`. g. '# 0033ffff' (中文(简体) )

### `ringIsBboxRectangle(ring)`

###### 参数

-   `ring` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `ringToGeojsonPolygon(ring, close)`

###### 参数

-   `ring` (单位:千美元)`Array<Point>`(中文(简体) )
-   `close` (单位:千美元)`boolean | undefined`(中文(简体) )

###### 回返

`{type: 'Polygon'; coordinates: number[][][]}`。 。 。 .

### `rms(from, to)`

###### 参数

-   `from` (单位:千美元)`Array<Point>`(中文(简体) )
-   `to` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`number`。 。 。 .

### `rotateArray(array, offset)`

###### 参数

-   `array` (单位:千美元)`Array<T>`(中文(简体) )
-   `offset` (单位:千美元)`number`(中文(简体) )

###### 回返

`Array<T>`。 。 。 .

### `rotatePoint(point, angle, pivot, cosAngle, sinAngle)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `angle` (单位:千美元)`number | undefined`(中文(简体) )
-   `pivot` (单位:千美元)`Point | undefined`(中文(简体) )
-   `cosAngle?` (单位:千美元)`number | undefined`(中文(简体) )
-   `sinAngle?` (单位:千美元)`number | undefined`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `rotatePoints(points, angle, pivot)`

###### 参数

-   `points` (单位:千美元)`Array<Point>`(中文(简体) )
-   `angle` (单位:千美元)`number | undefined`(中文(简体) )
-   `pivot` (单位:千美元)`Point | undefined`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `scaleBbox(bbox, scale)`

###### 参数

-   `bbox` (单位:千美元)`[number, number, number, number]`(中文(简体) )
-   `scale` (单位:千美元)`number`(中文(简体) )

###### 回返

`[number, number, number, number]`。 。 。 .

### `scalePoint(point, scale)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `scale` (单位:千美元)`number`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `scalePoints(points, scale)`

###### 参数

-   `points` (单位:千美元)`Array<Point>`(中文(简体) )
-   `scale` (单位:千美元)`number`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `scaleSize(size, scale)`

###### 参数

-   `size` (单位:千美元)`[number, number]`(中文(简体) )
-   `scale` (单位:千美元)`number`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `shallowCopyArrayMatrix(arrayMatrix)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `sizeToBbox(size, center)`

###### 参数

-   `size` (单位:千美元)`[number, number]`(中文(简体) )
-   `center?` (单位:千美元)`Point | undefined`(中文(简体) )

###### 回返

`[number, number, number, number]`。 。 。 .

### `sizeToCenter(size)`

###### 参数

-   `size` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `sizeToRectangle(size, center)`

###### 参数

-   `size` (单位:千美元)`[number, number]`(中文(简体) )
-   `center?` (单位:千美元)`Point | undefined`(中文(简体) )

###### 回返

`[Point, Point, Point, Point]`。 。 。 .

### `sizeToResolution(size)`

###### 参数

-   `size` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `sizesToScale(size0, size1, fit)`

从两个大小计算一个比例尺

对于未说明的“ fit” , 比例尺是根据大小产生的表面积来计算的.

用于指定的“ fit ” :

平方矩形 bbox0 '\*' 和 bbox1' 示例 :

'cain' 其中'\*'包含' (在第一个尺寸0中相对较宽)

```
           ****
           *  *
```

**.** .

-   . \* (中文(简体) ). **.** . \* \* 翻译: 页:1

盖' \*'被'所覆盖 (在第一个尺寸0中相对较宽)

```
           ....
           .  .
```

.****. . . . . 所出所出所出所出所出所出所出所出所出所出所出 .****. . . . . . . .. .

“ 相等 ” , 其中“ \* ” 与“ ” 相同 (在第一个尺寸0中相对较宽)

```
****       ....
```

。 。 。 ._._。 。 。 . _.\*\* (中文(简体) )._ .\* (中文(简体) ) _。 。 。 . _. . .._ 。 。 。 ._. . \* (中文(简体) ). _.\*\* (中文(简体) )._ \*\*\*\*.

###### 参数

-   `size0` (单位:千美元)`[number, number]`(中文(简体) )
    -   第一个大小
-   `size1` (单位:千美元)`[number, number]`(中文(简体) )
    -   第二个大小
-   `fit?` (单位:千美元)`Fit | undefined`(中文(简体) )
    -   合适的

###### 回返

`number`。 。 。 .

### `sliceArrayMatrix(arrayMatrix, rowsStart, colsStart, rowsEnd, colsEnd)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )
-   `rowsStart` (单位:千美元)`number`(中文(简体) )
-   `colsStart` (单位:千美元)`number`(中文(简体) )
-   `rowsEnd?` (单位:千美元)`number | undefined`(中文(简体) )
-   `colsEnd?` (单位:千美元)`number | undefined`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `squaredDistance(from, to)`

###### 参数

-   `from` (单位:千美元)`[number, number]`(中文(简体) )
-   `to` (单位:千美元)`Point | undefined`(中文(简体) )

###### 回返

`number`。 。 。 .

### `stepDistanceAngle(point, dist, angle)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `dist` (单位:千美元)`number`(中文(简体) )
-   `angle` (单位:千美元)`number`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `stringToSvgGeometriesGenerator(svg)`

###### 参数

-   `svg` (单位:千美元)`string`(中文(简体) )

###### 回返

`Generator<SvgGeometry, void, unknown>`。 。 。 .

### `subArrayMatrix(arrayMatrix, rows, cols)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )
-   `rows` (单位:千美元)`Array<number>`(中文(简体) )
-   `cols` (单位:千美元)`Array<number>`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `subSetArray(arr1, arr2)`

###### 参数

-   `arr1` (单位:千美元)`Array<T>`(中文(简体) )
-   `arr2` (单位:千美元)`Array<T>`(中文(简体) )

###### 回返

`boolean`。 。 。 .

### `svgGeometriesToSvgString(geometries)`

###### 参数

-   `geometries` (单位:千美元)`Array<SvgGeometry>`(中文(简体) )

###### 回返

`string`。 。 。 .

### `svgGeometryToGeometry(svgCircle)`

###### 参数

-   `svgCircle` (单位:千美元)`{type: 'circle'; attributes?: SvgAttributes; coordinates: Point}`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `svgGeometryToString(geometry)`

###### 参数

-   `geometry` (单位:千美元)`SvgCircle | SvgLine | SvgPolyLine | SvgPolygon | SvgRect`(中文(简体) )

###### 回返

`string`。 。 。 .

### `threePointsToAngle(pointA, pointB, pointC)`

由 B 和 C 点在 A 点 下生成的回角α

###### 参数

-   `pointA` (单位:千美元)`[number, number]`(中文(简体) )
-   `pointB` (单位:千美元)`[number, number]`(中文(简体) )
-   `pointC` (单位:千美元)`[number, number]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `translatePoint(point, translationPoint, addOrSubstract)`

###### 参数

-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `translationPoint` (单位:千美元)`[number, number]`(中文(简体) )
-   `addOrSubstract` (单位:千美元)`'add' | 'substract' | undefined`(中文(简体) )

###### 回返

`[number, number]`。 。 。 .

### `translatePoints(points, point, addOrSubstract)`

###### 参数

-   `points` (单位:千美元)`Array<Point>`(中文(简体) )
-   `point` (单位:千美元)`[number, number]`(中文(简体) )
-   `addOrSubstract` (单位:千美元)`'add' | 'substract' | undefined`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

### `transposeArrayMatrix(arrayMatrix)`

###### 参数

-   `arrayMatrix` (单位:千美元)`Array<Array<T>>`(中文(简体) )

###### 回返

`Array<Array<T>>`。 。 。 .

### `triangleAngles(triangle)`

###### 参数

-   `triangle` (单位:千美元)`[Point, Point, Point]`(中文(简体) )

###### 回返

`[number, number, number]`。 。 。 .

### `triangleArea(triangle)`

###### 参数

-   `triangle` (单位:千美元)`[Point, Point, Point]`(中文(简体) )

###### 回返

`number`。 。 。 .

### `uncloseMultiPolygon(multiPolygon)`

###### 参数

-   `multiPolygon` (单位:千美元)`Array<Array<Array<Point>>>`(中文(简体) )

###### 回返

`Array<Array<Array<Point>>>`。 。 。 .

### `unclosePolygon(polygon)`

###### 参数

-   `polygon` (单位:千美元)`Array<Array<Point>>`(中文(简体) )

###### 回返

`Array<Array<Point>>`。 。 。 .

### `uncloseRing(ring)`

###### 参数

-   `ring` (单位:千美元)`Array<Point>`(中文(简体) )

###### 回返

`Array<Point>`。 。 。 .

## 常见问题

### @allmaps/stdlib 是什么？

全部地图标准库

### 如何安装 @allmaps/stdlib？

在项目目录运行 npm install @allmaps/stdlib，或使用 pnpm add / yarn add / bun add。

### @allmaps/stdlib 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/allmaps\_\_stdlib 是否存在。

### @allmaps/stdlib 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @allmaps/stdlib 可以商用吗？

@allmaps/stdlib 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @allmaps/stdlib 的下载量有多少？

根据 npm 官方下载统计，@allmaps/stdlib 在 2026/10/06 – 2026/11/04 这 30 天内被下载 11,705 次，日均约 390 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @allmaps/stdlib 还在维护吗？

最新版本 1\.0\.0-beta\.42 发布于 2026/09/22（1 个月前）；至今共发布 36 个版本，其中过去 12 个月发布了 5 个；首次发布于 2023/02/16。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

