# 地理空间函数

这些函数用于在地图可视化中处理地理空间数据。Qlik Sense 遵照 GeoJSON 针对地理空间数据的规定并支持以下几项：

* 点
* Linestring
* 多边形
* Multipolygon

有关 GeoJSON 规定的更多信息，请参见：

[GeoJSON.org](http://geojson.org/)

[映射图表](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Visualizations/Map/Map.htm)

使用每个函数的下拉列表可查看每个函数的简短描述和语法。单击语法描述中的函数名称可了解更多信息。





可以使用两种类别的地理空间函数：聚合和非聚合。

聚合函数使用几何体聚合（点或地区）作为输入，并返回单一几何体。例如，可以将多个地区合并在一起，并在地图上绘制聚合的单个边界。

非聚合函数使用单一几何体并返回一个几何体。例如，对于函数 GeoGetPolygonCenter()，如果将一个地区的边界几何体设置为输入，则返回该地区中心的点几何体（经度和纬度）。

以下是聚合函数：

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoAggrGeometry

GeoAggrGeometry() 可用于将多个区域聚合成一个较大的区域，如将多个子区域聚合成一个区域。

[**GeoAggrGeometry**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoAggrGeometry.htm)(field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoBoundingBox

GeoBoundingBox() 可用于将几何体聚合到区域中，并用于计算包含所有坐标的最小边界框。

[**GeoBoundingBox**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoBoundingBox.htm)(field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoCountVertex

GeoCountVertex() 可用于查找多边形几何体包含的矢量的个数。

[**GeoCountVertex**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoCountVertex.htm)(field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoInvProjectGeometry

GeoInvProjectGeometry() 可用于将几何体聚合到区域中，并可应用投影的反面。

[**GeoInvProjectGeometry**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoInvProjectGeometry.htm)(type, field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoProjectGeometry

GeoProjectGeometry() 可用于将几何体聚合到区域中，并可应用投影。

[**GeoProjectGeometry**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoProjectGeometry.htm)(type, field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoReduceGeometry

GeoReduceGeometry() 用于缩减几何体包含的矢量的个数，并将多个区域聚合成一个区域，以及显示个别区域的边界线。

[**GeoReduceGeometry**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoReduceGeometry.htm)(geometry)

  
以下是非聚合函数：

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoGetBoundingBox

GeoGetBoundingBox() 可在脚本和图表表达式中用于计算包含几何体所有坐标的最小地理空间边界框。

[**GeoGetBoundingBox**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoGetBoundingBox.htm)(geometry)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoGetPolygonCenter

GeoGetPolygonCenter() 可在脚本和图表表达式中用于计算和返回几何体的中心点。

[**GeoGetPolygonCenter**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoGetPolygonCenter.htm)(geometry)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoMakePoint

GeoMakePoint() 可在脚本和图表表达式中用于通过经度和纬度创建和标记某个点。

[**GeoMakePoint**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoMakePoint.htm)(lat\_field\_name, lon\_field\_name)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### GeoProject

GeoProject() 可在脚本和图表表达式中用于将投影应用于几何体。

[**GeoProject**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/GeoProject.htm)(geo\_data)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### MakeGeoLine

MakeGeoLine() 用于验证 JSON 中的地理数据，并在字段上设置相应的标签。MakeGeoLine() 确认数据是一个包含点的数组。

[**MakeGeoLine**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/MakeGeoLine.htm)(geo\_data)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### MakeGeoPolygon

MakeGeoPolygon() 用于在 JSON 中验证地理数据，并在字段上设置适当的标签。MakeGeoPolygon() 确认数据是一个包含线段的数组。

[**MakeGeoPolygon**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/MakeGeoPolygon.htm)(geo\_data)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### MakeGeoPoint

MakeGeoPoint() 用于验证 JSON 中的地理数据并在字段上设置相应的标签。MakeGeoPoint() 确认数据是包含两个数字的数组。

[**MakeGeoPoint**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/MakeGeoPoint.htm)(geo\_data)

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/geospatial-functions.htm)

#### MakeGeoRegion

MakeGeoRegion() 用于验证 JSON 中的地理数据并为字段设置相应的标签。MakeGeoRegion() 确认数据是包含多边形的数组。

[**MakeGeoRegion**](https://help.qlik.com/zh-CN/sense/May2026/Subsystems/Hub/Content/Sense_Hub/Scripting/GeospatialFunctions/MakeGeoRegion.htm)(geo\_data)