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
50 changes: 50 additions & 0 deletions docs-overrides/assets/stylesheets/components/_lang-switch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.sd-lang-switch {
display: inline-flex;
align-items: stretch;
margin: 0 0.4rem;
padding: 2px;
border: 1px solid rgba(255, 255, 255, 0.45);
border-radius: 999px;
background: rgba(255, 255, 255, 0.08);
font-size: 0.72rem;
line-height: 1;

&__item {
display: inline-flex;
align-items: center;
padding: 0.28rem 0.7rem;
color: rgba(255, 255, 255, 0.85);
text-decoration: none;
border-radius: 999px;
font-weight: 600;
letter-spacing: 0.02em;
transition: background-color 120ms ease, color 120ms ease;

&:hover,
&:focus {
color: #ffffff;
background-color: rgba(255, 255, 255, 0.18);
}

&--active {
color: #ca463a;
background-color: #ffffff;

&:hover,
&:focus {
color: #ca463a;
background-color: #ffffff;
}
}
}
}

@media (max-width: 600px) {
.sd-lang-switch {
font-size: 0.68rem;

&__item {
padding: 0.22rem 0.55rem;
}
}
}
1 change: 1 addition & 0 deletions docs-overrides/assets/stylesheets/extra.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@import "components/footer";
@import "components/sidebar";
@import "components/search-tags";
@import "components/lang-switch";

// Pages
@import "pages/page-home";
Expand Down
360 changes: 250 additions & 110 deletions docs-overrides/main.html

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions docs-overrides/partials/alternate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% if config.extra.alternate and config.extra.alternate | length > 1 %}
<nav class="sd-lang-switch" aria-label="{{ lang.t('select.language') }}">
{% for alt in config.extra.alternate %}
{%- set is_active = (alt.lang == config.theme.language) -%}
<a
href="{{ alt.link | url }}"
hreflang="{{ alt.lang }}"
lang="{{ alt.lang }}"
target="_self"
class="sd-lang-switch__item{% if is_active %} sd-lang-switch__item--active{% endif %}"
{% if is_active %}aria-current="true"{% endif %}
>{{ alt.name }}</a>
{% endfor %}
</nav>
{% endif %}
63 changes: 63 additions & 0 deletions docs/download.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--
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.
-->

## GitHub 代码仓库

最新源代码:[GitHub 代码仓库](https://github.com/apache/sedona/)

历史 GeoSpark 版本:[GitHub Releases](https://github.com/apache/sedona/releases)

每次提交到 master 分支后自动构建的二进制 JAR 包:[GitHub Action](https://github.com/apache/sedona/actions/workflows/java.yml)

## 校验完整性

[公钥](https://downloads.apache.org/sedona/KEYS)

[校验说明](https://www.apache.org/info/verification.html)

## 版本

### 1.9.0

| | 从 ASF 下载 | 校验和 | 签名 |
|:-----------------:|:----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|
| 源代码 | [src](https://www.apache.org/dyn/closer.lua/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-src.tar.gz.asc) |
| 二进制 | [bin](https://www.apache.org/dyn/closer.lua/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.9.0/apache-sedona-1.9.0-bin.tar.gz.asc) |

### 1.8.1

| | 从 ASF 下载 | 校验和 | 签名 |
|:-----------------:|:----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|
| 源代码 | [src](https://www.apache.org/dyn/closer.lua/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-src.tar.gz.asc) |
| 二进制 | [bin](https://www.apache.org/dyn/closer.lua/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.8.1/apache-sedona-1.8.1-bin.tar.gz.asc) |

### 1.7.2

| | 从 ASF 下载 | 校验和 | 签名 |
Comment on lines +38 to +52
|:-----------------:|:----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|
| 源代码 | [src](https://www.apache.org/dyn/closer.lua/sedona/1.7.2/apache-sedona-1.7.2-src.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.7.2/apache-sedona-1.7.2-src.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.7.2/apache-sedona-1.7.2-src.tar.gz.asc) |
| 二进制 | [bin](https://www.apache.org/dyn/closer.lua/sedona/1.7.2/apache-sedona-1.7.2-bin.tar.gz) | [sha512](https://downloads.apache.org/sedona/1.7.2/apache-sedona-1.7.2-bin.tar.gz.sha512) | [asc](https://downloads.apache.org/sedona/1.7.2/apache-sedona-1.7.2-bin.tar.gz.asc) |

### 历史版本

历史版本的 Sedona 已归档,可在以下位置找到:[Apache 归档](https://archive.apache.org/dist/sedona/)(1.2.1-incubating 及之后的版本)。

## 安全

如有安全相关问题,请参阅 https://www.apache.org/security/
111 changes: 111 additions & 0 deletions docs/sedonaflink.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<!--
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.
-->

# SedonaFlink

SedonaFlink 将地理空间函数集成到 Apache Flink 中,是构建依赖地理空间数据的流式管道的理想选择。

以下是 SedonaFlink 的一些典型应用场景:

* 从 Kafka 读取地理空间数据并写入 Iceberg
* [实时分析交通密度](https://www.alibabacloud.com/help/en/flink/realtime-flink/use-cases/analyze-traffic-density-with-flink-and-apache-sedona)
* 电信行业的实时网络规划与优化

下面是一些示例代码片段:

=== "Java"

```java
sedona.createTemporaryView("myTable", tbl)
Table geomTbl = sedona.sqlQuery("SELECT ST_GeomFromWKT(geom_polygon) as geom_polygon, name_polygon FROM myTable")
geomTbl.execute().print()
Comment on lines +35 to +37
```

=== "PyFlink"

```python
table_env.sql_query("SELECT ST_ASBinary(ST_Point(1.0, 2.0))").execute().collect()
```

## 主要特性

* **实时地理空间流处理**,满足低延迟处理需求。
* **可扩展**,适用于大规模流式管道。
* 基于 Flink 的时间窗口实现**事件时间处理**。
* 提供**精确一次(Exactly Once)**处理保证。
* **可移植**,易于在任何 Flink 运行时中部署。
* **开源**,遵循 Apache 软件基金会的准则进行管理。

## 为什么在 Flink 上使用 Sedona?

Flink 是为流式数据而设计的,Sedona 在此基础上为其加入了地理空间处理能力。

大多数地理空间处理发生在 Spark 或 PostGIS 这类批处理系统中,对于延迟要求不高的场景这没有问题。

而当需要实时处理地理空间数据时,Sedona on Flink 的优势就会显现出来。

Flink 可以为地理空间查询提供毫秒级的延迟。

Flink 拥有完善的容错机制,即使在故障发生时,地理空间管道也不会丢失数据。

Sedona on Flink 可以在 Flink 支持的任何环境中运行,包括 Kubernetes、YARN 以及独立集群。

## 工作原理

Sedona 直接集成到 Flink 的 Table API 和 SQL 引擎中。

在搭建 Flink 环境时注册 Sedona 的空间函数,即可在 SQL 查询中使用 `ST_Point`、`ST_Contains`、`ST_Distance` 等函数。

Sedona 同时支持 Flink 的 DataStream API 与 Table API,可根据自身工作流程选用。

空间运算作为 Flink 分布式执行的一部分运行,因此地理空间计算会自动在集群中并行执行。

Sedona 在 Flink 内部以二进制方式存储几何对象,从而保持较低的内存占用与较高的处理速度。

执行空间连接时,Sedona 在底层使用空间索引,使查询能够快速完成。

容错由 Flink 的检查点(checkpoint)机制处理。如果某个节点崩溃,地理空间状态可以从最近一次检查点恢复。

通常的流程是:从 Kafka 或文件系统等数据源读取地理空间数据,使用 Sedona 的空间函数进行处理,然后将结果写入 Iceberg 等数据汇。

整条 SedonaFlink 管道持续运行,新事件会实时流过空间转换逻辑。

## 与其他方案的对比

对于较小的数据集,可能并不需要分布式集群,使用 SedonaDB 即可。

对于大规模批处理管道,可以使用 SedonaSpark。

下面是 SedonaFlink 与几种流式方案的直接对比。

**SedonaFlink 与 Sedona on Spark Structured Streaming**

Spark Streaming 采用微批(micro-batch)模式,而 Flink 是逐事件处理。在某些工作流中,这能让 Flink 的延迟更低。

Flink 的状态管理也更为成熟。

如果已经深度使用 Spark 生态,且 Spark Structured Streaming 的延迟可以满足需求,可以选择 Spark;如果对延迟有非常严苛的要求,建议选择 Flink。

**Sedona on Flink 与 PostGIS**

PostGIS 非常适合用于 OLTP 工作负载下的地理空间数据存储与查询,但它并不是为流式处理而设计的。

如果使用 PostGIS 处理流式工作负载,需要持续从流处理器中查询数据库,这会增加延迟,并对数据库造成压力。

SedonaFlink 在数据流转过程中即对地理空间数据进行处理,从而避免了与数据库之间的往返开销。
55 changes: 55 additions & 0 deletions docs/sedonasnow.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
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.
-->

# SedonaSnow

SedonaSnow 将 Apache Sedona 的 200 多个地理空间函数直接引入到 Snowflake 环境中,作为 Snowflake 原生空间函数的有力补充。

## 主要优势

* **200+ 空间函数**:例如 3D 距离、几何对象校验、精度归约等
* **高性能空间连接**:Sedona 针对空间连接做了专门优化
* **无缝集成**:与 Snowflake 原生函数协同工作
* **数据无需移动**:所有处理都在 Snowflake 内部完成

## 快速上手

下面是一个使用 SedonaSnow 在 Snowflake 表上执行查询的示例。

```sql
USE DATABASE SEDONASNOW;

SELECT SEDONA.ST_GeomFromWKT(wkt) AS geom
FROM your_table;

SELECT SEDONA.ST_3DDistance(geom1, geom2) FROM spatial_data;
```

下面是一个空间连接的示例:

```sql
SELECT * FROM lefts, rights
WHERE lefts.cellId = rights.cellId;
```

可以看出,SedonaSnow 能够无缝地接入现有的 Snowflake 环境。

## 后续步骤

如果您正在 Snowflake 中进行严肃的空间分析工作,SedonaSnow 是一个非常合适的选择。它运行速度快,并提供了丰富的空间函数。SedonaSnow 在不需要将数据迁移到其他平台的前提下,突破了 Snowflake 内置空间函数的能力限制。
Loading
Loading