Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 10.geography.md #1746

Merged
merged 1 commit into from
Apr 28, 2022
Merged
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
32 changes: 16 additions & 16 deletions docs-2.0/3.ngql-guide/3.data-types/10.geography.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ nebula> INSERT EDGE any_shape_edge(geo) VALUES "201"->"302":(ST_GeogFromText("PO

//查询点 103 的属性 geo。
nebula> FETCH PROP ON any_shape "103" YIELD ST_ASText(any_shape.geo);
+----------+---------------------------------+
| VertexID | ST_ASText(any_shape.geo) |
+----------+---------------------------------+
| "103" | "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+----------+---------------------------------+
+---------------------------------+
| ST_ASText(any_shape.geo) |
+---------------------------------+
| "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+---------------------------------+

//查询边 201->302 的属性 geo。
nebula> FETCH PROP ON any_shape_edge "201"->"302" YIELD ST_ASText(any_shape_edge.geo);
+---------------------+---------------------+----------------------+---------------------------------+
| any_shape_edge._src | any_shape_edge._dst | any_shape_edge._rank | ST_ASText(any_shape_edge.geo) |
+---------------------+---------------------+----------------------+---------------------------------+
| "201" | "302" | 0 | "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+---------------------+---------------------+----------------------+---------------------------------+
+---------------------------------+
| ST_ASText(any_shape_edge.geo) |
+---------------------------------+
| "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+---------------------------------+

//为 geo 属性创建索引并使用 LOOKUP 查询。
nebula> CREATE TAG INDEX IF NOT EXISTS any_shape_geo_index ON any_shape(geo);
nebula> REBUILD TAG INDEX any_shape_geo_index;
nebula> LOOKUP ON any_shape YIELD ST_ASText(any_shape.geo);
+----------+-------------------------------------------------+
| VertexID | ST_ASText(any_shape.geo) |
+----------+-------------------------------------------------+
| "103" | "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+----------+-------------------------------------------------+
+---------------------------------+
| ST_ASText(any_shape.geo) |
+---------------------------------+
| "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+---------------------------------+
```

为 geo 属性创建索引时,还可以指定 geo 索引的参数。说明如下。
Expand All @@ -90,4 +90,4 @@ nebula> LOOKUP ON any_shape YIELD ST_ASText(any_shape.geo);

```ngql
nebula> CREATE TAG INDEX IF NOT EXISTS any_shape_geo_index ON any_shape(geo) with (s2_max_level=30, s2_max_cells=8);
```
```