跳转至

Parse GeoJSON from a non-WGS 84 coordinate system(从非 WGS 84 坐标系解析 GeoJSON)

Supported in: Batch, Faster, Streaming

Convert GeoJSON string from a non-WGS 84 coordinate system to WGS 84 geometry. For GeoJSON already in WGS 84 (longitude, latitude), the "logical type cast" expression can convert directly with less overhead. Returns null for strings that fail during parsing or conversion.

Expression categories: Geospatial

Declared arguments

  • GeoJSON string: GeoJSON as a string. Note that not all GeoJSON strings are indexable by the Ontology; use the "normalize geometry" expression to prepare geometry prior to Ontology use.
    Expression\
  • Source coordinate system: Coordinate system identifier formatted as "authority:id". For example, UTM zone 18N could be identified by EPSG:32618.
    Literal\

Output type: Geometry

Examples

Example 1: Base case

Argument values:

  • GeoJSON string: geojson_string
  • Source coordinate system: EPSG:32618
geojson_string Output
{"type":"Point","coordinates":[320000.0,4300000.0]} {"type":"Point","coordinates":[-77.07368071728229,38.83040844313318]}
{"type":"LineString","coordinates":[[320000.0,4300000.0],[320100.0,4300000.0]]} {"type":"LineString","coordinates":[[-77.07368071728229,38.83040844313318],[-77.0725293738795,38.83042888342659]]}
{"type":"Polygon","coordinates":[[[320000.0,4300000.0],[320100.0,4300000.0],[320000.0,4300100.0],[320000.0,4300000.0]]]} {"type":"Polygon","coordinates":[[[-77.07368071728229,38.83040844313318],[-77.0725293738795,38.83042888342659],[-77.07370685720375,38.83130901341597],[-77.07368071728229,38.83040844313318]]]}

Example 2: Null case

Argument values:

  • GeoJSON string: geojson_string
  • Source coordinate system: EPSG:32618
geojson_string Output
null null

Example 3: Edge case

Argument values:

  • GeoJSON string: geojson_string
  • Source coordinate system: EPSG:32618
geojson_string Output
invalid geojson string null


中文翻译


从非 WGS 84 坐标系解析 GeoJSON

支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

将非 WGS 84 坐标系的 GeoJSON 字符串转换为 WGS 84 几何图形。对于已采用 WGS 84(经度,纬度)的 GeoJSON,可直接使用"逻辑类型转换"表达式进行转换,开销更小。若字符串在解析或转换过程中失败,则返回 null。

表达式类别: 地理空间(Geospatial)

声明的参数

  • GeoJSON 字符串: 以字符串形式表示的 GeoJSON。请注意,并非所有 GeoJSON 字符串都可被 Ontology 索引;请在使用 Ontology 前使用"标准化几何图形"表达式对几何图形进行预处理。
    表达式\<String>
  • 源坐标系: 格式为"authority:id"的坐标系标识符。例如,UTM 18N 区可标识为 EPSG:32618。
    字面量\<String>

输出类型: Geometry

示例

示例 1:基本情况

参数值:

  • GeoJSON 字符串: geojson_string
  • 源坐标系: EPSG:32618
geojson_string 输出
{"type":"Point","coordinates":[320000.0,4300000.0]} {"type":"Point","coordinates":[-77.07368071728229,38.83040844313318]}
{"type":"LineString","coordinates":[[320000.0,4300000.0],[320100.0,4300000.0]]} {"type":"LineString","coordinates":[[-77.07368071728229,38.83040844313318],[-77.0725293738795,38.83042888342659]]}
{"type":"Polygon","coordinates":[[[320000.0,4300000.0],[320100.0,4300000.0],[320000.0,4300100.0],[320000.0,4300000.0]]]} {"type":"Polygon","coordinates":[[[-77.07368071728229,38.83040844313318],[-77.0725293738795,38.83042888342659],[-77.07370685720375,38.83130901341597],[-77.07368071728229,38.83040844313318]]]}

示例 2:空值情况

参数值:

  • GeoJSON 字符串: geojson_string
  • 源坐标系: EPSG:32618
geojson_string 输出
null null

示例 3:边界情况

参数值:

  • GeoJSON 字符串: geojson_string
  • 源坐标系: EPSG:32618
geojson_string 输出
invalid geojson string null