Skip to content

Commit 97d43e8

Browse files
committed
Merge branch 'spatial_start' of https://github.com/teunbrand/ggsql into spatial_start
2 parents 8746253 + b870622 commit 97d43e8

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

doc/syntax/layer/type/spatial.qmd

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Spatial"
55
> Layers are declared with the [`DRAW` clause](../../clause/draw.qmd). Read the documentation for this clause for a thorough description of how to use it.
66
77
The spatial layer is used to render geographic geometries consisting of polygons, lines and points used to make maps like choropleths.
8-
It differs from other layers in that uses a special [simple features](https://en.wikipedia.org/wiki/Simple_Features) geometry column that defines the shapes.
8+
It differs from other layers in that it uses a special [simple features](https://en.wikipedia.org/wiki/Simple_Features) geometry column that defines the shapes.
99

1010
## Aesthetics
1111
The following aesthetics are recognised by the spatial layer.
@@ -48,37 +48,39 @@ Note that the geometry column is automatically detected.
4848

4949
```{ggsql}
5050
VISUALISE FROM ggsql:world
51-
DRAW spatial
51+
DRAW spatial
5252
```
5353

5454
If the geometry column isn't automatically detected —for example because it has a non-standard name— you may need to declare the mapping explicitly.
5555

5656
```{ggsql}
5757
SELECT geom AS foo FROM ggsql:world
5858
VISUALISE
59-
DRAW spatial MAPPING foo AS geometry
59+
DRAW spatial
60+
MAPPING foo AS geometry
6061
```
6162

6263
Filtering on other columns.
6364

6465
```{ggsql}
6566
VISUALISE FROM ggsql:world
66-
DRAW spatial FILTER continent == 'Asia'
67+
DRAW spatial
68+
FILTER continent == 'Asia'
6769
```
6870

6971
Filtering based on spatial operations.
7072

7173
```{ggsql}
7274
VISUALISE FROM ggsql:world
73-
DRAW spatial
74-
FILTER ST_Intersects(geom, ST_MAkeEnvelope(-20.0, -35.0, 55.0, 38.0))
75+
DRAW spatial
76+
FILTER ST_Intersects(geom, ST_MakeEnvelope(-20.0, -35.0, 55.0, 38.0))
7577
```
7678

7779
Make a choropleth map by mapping a variable to a fill aesthetic.
7880

7981
```{ggsql}
8082
VISUALISE FROM ggsql:world
81-
DRAW spatial
82-
MAPPING population AS fill
83-
SETTING opacity => 1
83+
DRAW spatial
84+
MAPPING population AS fill
85+
SETTING opacity => 1
8486
```

0 commit comments

Comments
 (0)