Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogCollFromText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogCollFromText

Introduction: Constructs a GeometryCollection geography from the WKT with the given SRID. If SRID is not provided then it defaults to 0. It returns `null` if the WKT is not a `GEOMETRYCOLLECTION`.

Format:

`ST_GeogCollFromText (Wkt: String)`

`ST_GeogCollFromText (Wkt: String, srid: Integer)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogCollFromText('GEOMETRYCOLLECTION (POINT (1 2), LINESTRING (0 0, 1 1))')
```

Output:

```
GEOMETRYCOLLECTION (POINT (1 2), LINESTRING (0 0, 1 1))
```
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromEWKB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromEWKB

Introduction: Construct a Geography from EWKB Binary. This function is an alias of [ST_GeogFromWKB](ST_GeogFromWKB.md). The SRID embedded in the EWKB is attached to the resulting geography.

Format:

`ST_GeogFromEWKB (EWkb: Bytes)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromEWKB([01 02 00 00 20 E6 10 00 00 02 00 00 00 00 00 00 00 84 D6 00 C0 00 00 00 00 80 B5 D6 BF 00 00 00 60 E1 EF F7 BF 00 00 00 80 07 5D E5 BF])
```

Output:

```
LINESTRING (-2.1 -0.4, -1.5 -0.7)
```

The EWKB above embeds SRID `4326`, which is carried over to the resulting geography.
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromEWKT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromEWKT

Introduction: Construct a Geography from OGC Extended WKT.

Format:

`ST_GeogFromEWKT (EWkt: String)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromEWKT('SRID=4326;LINESTRING (0 0, 3 3, 4 4)')
```

Output:

```
LINESTRING (0 0, 3 3, 4 4)
```

The SRID parsed from the EWKT string (here `4326`) is attached to the resulting geography.
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromGeoHash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromGeoHash

Introduction: Create Geography from geohash string and optional precision. When precision is omitted, the full precision of the geohash string is used.

Format:

`ST_GeogFromGeoHash (geohash: String)`

`ST_GeogFromGeoHash (geohash: String, precision: Integer)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromGeoHash('s00twy01mt', 4)
```

Output:

```
POLYGON ((0.7 0.9, 1.1 0.9, 1.1 1.1, 0.7 1.1, 0.7 0.9))
```
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromText

Introduction: Construct a Geography from WKT. If SRID is not set, it defaults to 0 (unknown). Alias of [ST_GeogFromWKT](ST_GeogFromWKT.md).

Format:

`ST_GeogFromText (Wkt: String)`

`ST_GeogFromText (Wkt: String, srid: Integer)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromText('LINESTRING (1 2, 3 4, 5 6)')
```

Output:

```
LINESTRING (1 2, 3 4, 5 6)
```
44 changes: 44 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromWKB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromWKB

Introduction: Construct a Geography from WKB Binary. This function also supports EWKB format. If SRID is not provided then it defaults to 0.

Format:

`ST_GeogFromWKB (Wkb: Bytes)`

`ST_GeogFromWKB (Wkb: Bytes, srid: Integer)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromWKB([01 02 00 00 00 02 00 00 00 00 00 00 00 84 D6 00 C0 00 00 00 00 80 B5 D6 BF 00 00 00 60 E1 EF F7 BF 00 00 00 80 07 5D E5 BF])
```

Output:

```
LINESTRING (-2.1 -0.4, -1.5 -0.7)
```
56 changes: 56 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogFromWKT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogFromWKT

Introduction: Construct a Geography from WKT. If SRID is not set, it defaults to 0 (unknown).

Format:

`ST_GeogFromWKT (Wkt: String)`

`ST_GeogFromWKT (Wkt: String, srid: Integer)`

Return type: `Geography`

Since: `v1.9.1`

Example:

```sql
SELECT ST_GeogFromWKT('LINESTRING (1 2, 3 4, 5 6)')
```

Output:

```
LINESTRING (1 2, 3 4, 5 6)
```

Example with SRID:

```sql
SELECT ST_GeogFromWKT('LINESTRING (1 2, 3 4, 5 6)', 4326)
```

Output:

```
LINESTRING (1 2, 3 4, 5 6)
```
51 changes: 51 additions & 0 deletions docs/api/flink/Geography-Constructors/ST_GeogToGeometry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# ST_GeogToGeometry

Introduction:

This function constructs a planar Geometry object from a Geography. While Sedona makes every effort to preserve the original spatial object, the conversion is not always exact because Geography and Geometry have different underlying models:

* Geography represents shapes on the Earth's surface (spherical).
* Geometry represents shapes on a flat, Euclidean plane.

Because geography vertices are stored as points on the sphere, converting back to planar coordinates can introduce small floating-point differences. Wrap the result with [ST_ReducePrecision](../Geometry-Processing/ST_ReducePrecision.md) if you need a fixed number of decimals.

Sedona does not validate or enforce the SRID of the input Geography. Whatever SRID is attached to the Geography will be carried over to the resulting Geometry.

Format:

`ST_GeogToGeometry (geog: Geography)`

Return type: `Geometry`

Since: `v1.9.1`

Example:

```sql
SELECT ST_ReducePrecision(ST_GeogToGeometry(ST_GeogFromWKT('MULTILINESTRING ((90 90, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))', 4326)), 6)
```

Output:

```
MULTILINESTRING ((90 90, 20 20, 10 40), (40 40, 30 30, 40 20, 30 10))
```
Loading
Loading