Skip to content

Commit 56ae2ca

Browse files
committed
Update 02-geoviz.qmd
1 parent 291e629 commit 56ae2ca

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

02-geoviz.qmd

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ viz(img.geometry, color = img.B, alpha = rand(length(img.B)))
122122

123123
Other aesthetic options are available in the official documentation.
124124

125-
As another example, consider the visualization of data over a `GeometrySet`:
125+
As another example, consider the visualization of data over a set of geometries:
126126

127127
```{julia}
128-
gset = GeometrySet([
128+
geoms = [
129129
Triangle((12, 12), (15, 15), (12, 15)),
130130
Quadrangle((5, 12), (10, 15), (10, 18), (5, 15))
131-
])
131+
]
132132
133-
gis = georef((A=[0.1, 0.2], B=[0.3, 0.4]), gset)
133+
gis = georef((A=[0.1, 0.2], B=[0.3, 0.4]), geoms)
134134
135135
viz(gis.geometry, color = gis.A)
136136
```
@@ -206,6 +206,8 @@ fig
206206

207207
:::
208208

209+
### Reference systems
210+
209211
The `viz` and `viz!` functions are aware of coordinate reference systems, which is a quite
210212
unique feature of the framework, explored in the chapter [Map projections](06-projections.qmd).
211213

@@ -219,6 +221,35 @@ world = GeoIO.load("data/countries.geojson")
219221
viz(world.geometry, color = 1:nrow(world))
220222
```
221223

224+
### Axis customization
225+
226+
To customize the figure and axis, please refer to Makie.jl documentation. The following
227+
example illustrates the construction of a figure with two subfigures side by side. Each
228+
subfigure has an axis with title and axis labels:
229+
230+
```{julia}
231+
fig = Mke.Figure()
232+
ax1 = Mke.Axis(fig[1, 1], title = "Image", xlabel = "Easting", ylabel = "Northing")
233+
ax2 = Mke.Axis(fig[1, 2], title = "Shapes", xlabel = "Easting", ylabel = "Northing")
234+
fig
235+
```
236+
237+
We can use `viz!` to add geospatial data to the existing axes:
238+
239+
```{julia}
240+
viz!(ax1, img.geometry, color = img.A)
241+
viz!(ax2, gis.geometry, color = gis.B)
242+
fig
243+
```
244+
245+
Or use `viz` to create a new axis in a new subfigure:
246+
247+
```{julia}
248+
viz(fig[2, 1], world.geometry, color = 1:nrow(world))
249+
viz(fig[2, 2], world.geometry, color = area.(world.geometry))
250+
fig
251+
```
252+
222253
## viewer
223254

224255
As geospatial data scientists we are often interested in quick inspection

0 commit comments

Comments
 (0)