注: 以下の翻訳の正確性は検証されていません。AIPを利用して英語版の原文から機械的に翻訳されたものです。

ジオメトリの準備

サポート対象:バッチ、ストリーミング

ジオメトリ文字列を有効な GeoJSON に変換して、オントロジーへのインデックス化など、下流で使用するためにジオメトリを準備します。ポリゴンは閉じられ、重複が除去されます。幅が180度を超えることで示される、反子午線をまたぐジオメトリは、反子午線の両側で複数のフィーチャーに分割されます。デフォルトでは、この操作は変換されたジオメトリを返し、文字列を変換できない場合は null を返します。一方、「show errors」出力モードでは、正常にパースされた出力、または内容を説明するエラーメッセージのいずれかを含む構造体を出力します。

式のカテゴリー: 地理空間

宣言された引数

  • ジオメトリ文字列: パースして GeoJSON に変換するジオメトリ文字列。
    Expression<String>
  • 任意 出力モード: 変換結果のジオメトリを出力し、エラーを null として返すシンプルな出力、または2個のフィールドを持つ構造体の出力を選択します。構造体には、変換できる場合は結果のジオメトリを含む「ok」フィールド、それ以外の場合は内容を説明するエラーメッセージを含む「error」フィールドが格納されます。
    Enum<Simple, With errors>

出力タイプ: Geometry | Struct<ok, error>

例

例1:基本ケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"Polygon","coordinates":[[[0.0,0.0],[10.0,0.0],[10.0,10.0],[0.0,10.0],[0.0,0.0]]]}{"type":"Polygon","coordinates":[[[0.0,0.0],[0.0,10.0],[10.0,10.0],[10.0,0.0],[0.0,0.0]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0,1.0],[1.0,0.0,1.0],[0.0,1.0,1.0],[0.0,0.0,1.0]]]}{"type":"Polygon","coordinates":[[[0.0,0.0,1.0],[0.0,1.0,1.0],[1.0,0.0,1.0],[0.0,0.0,1.0]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0], [0.0,1.0]]]}{"type":"Polygon","coordinates":[[[0.0,0.0],[0.0,1.0],[1.0,0.0],[0.0,0.0]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0], [1.0,0.0], [0.0,1.0], [0.0,0.0]]]}{"type":"Polygon","coordinates":[[[0.0,0.0],[0.0,1.0],[1.0,0.0],[0.0,0.0]]]}
{"type":"Polygon","coordinates":[[[179.0,-30.0],[-179.0,-30.0],[-179.0,30.0],[179.0,30.0],[179.0,-30]]]}{"type":"MultiPolygon","coordinates":[[[[-180.0,-30.0],[-180.0,30.0],[-179.0,30.0],[-179.0,-30.0],[-180.0,-30.0]]],[[[180.0,30.0],[180.0,-30.0],[179.0,-30.0],[179.0,30.0],[180.0,30.0]]]]}
{"type":"LineString","coordinates":[[179.0,30.0],[-179.0,30.0]]}{"type":"MultiLineString","coordinates":[[[179.0,30.0],[180.0,30.0]],[[-180.0,30.0],[-179.0,30.0]]]}
{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[40.0,10.0],[0.0,1.0]...{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[40.0,10.0],[0.0,1.0]...
{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1.0,0.0]},{"type":"LineString","coordinates":[[179.0,30.0],[-179.0,30.0]]}]}{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[1.0,0.0]},{"type":"MultiLineString","coordinates":[[[179.0,30.0],[180.0,30.0]],[[-180.0,30.0],[-179.0,30.0]]]}]}
{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[0.0,0.0],[1.0,0.0]]}...{"type":"MultiLineString","coordinates":[[[0.0,0.0],[1.0,0.0]],[[1.0,1.0],[2.0,1.0]]]}
{"type":"GeometryCollection","geometries":[{"type":"MultiLineString","coordinates":[[[0.0,0.0],[1.0,0.0]],[],[[1.0,1.0],[2.0,1.0]]]},{"type":"MultiPoint","coordinates":[[0.0,0.0],[1.0,1.0]]}]}{"geometries":[{"coordinates":[[[0.0,0.0],[1.0,0.0]],[[1.0,1.0],[2.0,1.0]]],"type":"MultiLineString"},{"coordinates":[[0.0,0.0],[1.0,1.0]],"type":"MultiPoint"}],"type":"GeometryCollection"}
{"type":"MultiPolygon","coordinates":[[[[1.0,1.0],[2.0,1.0],[2.0,2.0],[1.0,2.0],[1.0,1.0]]],[[]],[[[10.0,10.0],[20.0,10.0],[20.0,20.0],[10.0,20.0],[10.0,10.0]]]]}{"type":"MultiPolygon","coordinates":[[[[1.0,2.0],[2.0,2.0],[2.0,1.0],[1.0,1.0],[1.0,2.0]]],[[[10.0,20.0],[20.0,20.0],[20.0,10.0],[10.0,10.0],[10.0,20.0]]]]}

例2:基本ケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"MultiPolygon","coordinates":[[[[102.0,2.0],[102.0,3.0],[103.0,3.0],[103.0,2.0],[102.0,2.0]]]]}{"type":"Polygon","coordinates":[[[102.0,2.0],[102.0,3.0],[103.0,3.0],[103.0,2.0],[102.0,2.0]]]}
{"type":"MultiPolygon","coordinates":[[[]],[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]]]}{"type":"Polygon","coordinates":[[[102.0,2.0],[102.0,3.0],[103.0,3.0],[103.0,2.0],[102.0,2.0]]]}
{"type":"FeatureCollection","features":[{"geometry":{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[0.0,1.0],[1.0,0.0],[0.0,0.0]]]]},"properties":{"gaccname":"namehere"},"type":"Feature"}]}{"type":"Polygon","coordinates":[[[0.0,0.0],[0.0,1.0],[1.0,0.0],[0.0,0.0]]]}
{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[40.0,11.0],[0.0,1.0]]},{"type":"LineString","coordinates":[[10.0,10.0],[20.0,20.0],[10.0,40.0]]}]}{"type":"MultiLineString","coordinates":[[[40.0,11.0],[0.0,1.0]],[[10.0,10.0],[20.0,20.0],[10.0,40.0]]]}

例3:基本ケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,1.0],[0.0,1.0], [1.0,0.0], [0.0,0.0]]]}{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[0.5,0.5],[1.0,0.0],[0.0,0.0]]],[[[0.5,0.5],[0.0,1.0],[1.0,1.0],[0.5,0.5]]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0],[2.0,0.0],[1.0,1.0],[2.0,2.0],[0.0,2.0],[1.0,1.0],[0.0,0.0]]]}{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[1.0,1.0],[2.0,0.0],[0.0,0.0]]],[[[1.0,1.0],[0.0,2.0],[2.0,2.0],[1.0,1.0]]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0],[2.0,0.0],[2.0,2.0],[0.0,2.0],[0.0,0.0]],[[0.0,0.0],[2.0,0.0],[1.0,1.0],[0.0,0.0]]]}{"type":"Polygon","coordinates":[[[0.0,2.0],[2.0,2.0],[2.0,0.0],[1.0,1.0],[0.0,0.0],[0.0,2.0]]]}
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0],[1.0,1.0],[0.0,1.0],[0.0,0.0]],[[3.0,3.0],[4.0,3.0],[4.0,4.0],[3.0,4.0],[3.0,3.0]]]}{"type":"MultiPolygon","coordinates":[[[[0.0,1.0],[1.0,1.0],[1.0,0.0],[0.0,0.0],[0.0,1.0]]],[[[3.0,4.0],[4.0,4.0],[4.0,3.0],[3.0,3.0],[3.0,4.0]]]]}

例4:null ケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: with_errors
geometry出力
null{
 エラー:入力が null です,
 OK: null,
}
GeoJSON ではありません{
 エラー:入力文字列を GeoJSON としてパースできませんでした,
 OK: null,
}
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,0.0,1.0],[0.0,1.0],[0.0,0.0]]]}{
 エラー:座標の次元が混在しています,
 OK: null,
}
{"type":"LineString","coordinates":[[0.0,0.0]]}{
 エラー:LineString の点の数が無効です(1個検出されました。0個または >= 2個である必要があります),
 OK: null,
}
{"type":"Polygon","coordinates":[[[0.0,0.0],[1.0,91.0],[0.0,1.0],[0.0,0.0]]]}{
 エラー:座標が範囲外です。緯度は [-90, 90]、経度は [-180, 180] の範囲内である必要があります,
 OK: null,
}
{"type":"Polygon","coordinates":[[[0.0,-90.1],[1.0,0.0],[0.0,1.0],[0.0,0.0]]]}{
 エラー:座標が範囲外です。緯度は [-90, 90]、経度は [-180, 180] の範囲内である必要があります,
 OK: null,
}
{"type":"Polygon","coordinates":[[[0.0,0.0],[181.0,89.0],[0.0,1.0],[0.0,0.0]]]}{
 エラー:座標が範囲外です。緯度は [-90, 90]、経度は [-180, 180] の範囲内である必要があります,
 OK: null,
}
{"type":"Polygon","coordinates":[[[0.0,0.0],[-182.0,89.0],[0.0,1.0],[0.0,0.0]]]}{
 エラー:座標が範囲外です。緯度は [-90, 90]、経度は [-180, 180] の範囲内である必要があります,
 OK: null,
}
{"type":"Polygon","coordinates":[]}{
 エラー:ポリゴンにはリングが1つ以上含まれることが期待されます,
 OK: null,
}

例5:null ケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"Polygon","coordinates":[[]]}null

例6:エッジケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"coordinates": [[[-191.9065788394177,5.453742403668187],[-191.9065788394177,-11.163604962907428],[-...{"type":"MultiPolygon","coordinates":[[[[-180.0,-11.163604962907428],[-180.0,5.453742403668187],[-15...

例7:エッジケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"LineString","coordinates":[[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]}{"type":"Point","coordinates":[1.0,1.0]}

例8:エッジケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[1.0,0.0],[0.0,0.0]]],[[[102.0,2.0],[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]]]}{"type":"GeometryCollection","geometries":[{"type":"LineString","coordinates":[[0.0,0.0],[1.0,0.0]]},{"type":"Polygon","coordinates":[[[102.0,2.0],[102.0,3.0],[103.0,3.0],[103.0,2.0],[102.0,2.0]]]}]}

例9:エッジケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: null
geometry出力
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[-122.4000,37.8000]}]}]}]}{"coordinates":[-122.4, 37.8], "type":"Point"}
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"Geome...{"coordinates":[-122.4, 37.8], "type":"Point"}

例10:エッジケース

引数の値:

  • ジオメトリ文字列: geometry
  • 出力モード: with_errors
geometry出力
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"Point","coordinates":[-122.4000,37.8000]}]}]}]}{
 エラー: null,
 OK: {"type":"Point","coordinates":[-122.4,37.8]},
}
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"Geome...{
 エラー: null,
 OK: {"type":"Point","coordinates":[-122.4,37.8]},
}
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"Multi...{
 エラー: null,
 OK: {"type":"MultiLineString","coordinates":[[[-122.36,37...
{"type":"GeometryCollection","geometries":[{"type":"GeometryCollection","geometries":[{"type":"MultiPoint","coordinates":[[-122.4100,37.8100],[-122.4200,37.8200],[-122.4300,37.8300]]}]}]}{
 エラー: null,
 OK: {"type":"MultiPoint","coordinates":[[-122.41,37.81],[-122.42,37.82],[-122.43,37.83]]},
}