Skip to content

Commit

Permalink
Update 10.geography.md (#1312)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomJoe211 committed Apr 28, 2022
1 parent 22a98d0 commit 0501b94
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 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
//Query the geography of Vertex 103.
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))" |
+---------------------------------+
//Query the geography of the edge which traverses from Vertex 201 to Vertex 302.
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))" |
+---------------------------------+
//Create an index for the geography of the Tag any_shape and run 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))" |
+---------------------------------+
```

When creating an index for geography properties, you can specify the parameters for the index.
Expand Down

0 comments on commit 0501b94

Please sign in to comment.