Skip to content

Commit

Permalink
Update 10.geography.md (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomJoe211 authored Apr 28, 2022
1 parent e718246 commit e40c070
Showing 1 changed file with 16 additions and 16 deletions.
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);
```
```

0 comments on commit e40c070

Please sign in to comment.