Skip to content

Commit a5a1ac8

Browse files
committed
Text improvements
1 parent e995727 commit a5a1ac8

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

06-projections.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ of coordinate values without units can lead to major engineering failures such a
125125
[roller coaster derailment](https://web.archive.org/web/20100923105150/http://lamar.colostate.edu/~hillger/unit-mixups.html#spacemountain)
126126
at Tokyo Disneyland's Space Mountain.
127127

128-
Consider writing algorithms with units to avoid trivial issues in downstream applications:
128+
Consider writing algorithms with units to avoid trivial issues in critical applications:
129129

130130
```{julia}
131131
cart.x < 2u"ft"
@@ -384,7 +384,7 @@ viz(fig[1,2], grid |> Proj(GallPeters), showsegments = true)
384384
fig
385385
```
386386

387-
The formulas of some of `Projected` CRS are quite evolved, and sometimes depend on tabulated values.
387+
The formulas of some `Projected` CRS are quite evolved, and sometimes depend on tabulated values.
388388
Fortunately, this hard work has already been done in the [CoordRefSystems.jl](https://github.com/JuliaEarth/CoordRefSystems.jl)
389389
module.
390390

12-mining.qmd

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ will only use the **drillholes.csv** table.
5454

5555
Drill hole samples are always available in mining projects. They contain chemical
5656
information for each rock sample (a cylinder) along the drill hole trajectories.
57-
In this case, the data has been processed, and only the "X", "Y", "Z" coordinates
58-
of the centroids of the cylinders were stored:
57+
In this case, the data has been processed, and only the `Cartesian` "X", "Y", "Z"
58+
coordinates of the centroids of the cylinders were stored:
5959

6060
```{julia}
6161
url = "https://zenodo.org/record/7051975/files/drillholes.csv?download=1"
@@ -174,7 +174,7 @@ First, let's create our full `CartesianGrid` using the `boundingbox` of the traj
174174
bbox = boundingbox(dtable.geometry)
175175
176176
# size of blocks in meters
177-
bsize = (25.0, 25.0, 12.5)
177+
bsize = (25.0u"m", 25.0u"m", 12.5u"m")
178178
179179
# define Cartesian grid
180180
grid = CartesianGrid(extrema(bbox)..., bsize)
@@ -213,37 +213,39 @@ blocks = view(grid, active)
213213

214214
We would also like to filter `Hexahedron`s that are above the terrain.
215215
Let's create a simple terrain elevation model by interpolating the vertical
216-
"Z" coordinate of the first point of each trajectory:
216+
`z` coordinate of the first point of each trajectory:
217217

218218
```{julia}
219+
zcoord(point) = coords(point).z
220+
219221
ztable = @chain dtable begin
220222
@groupby(:HOLEID)
221-
@transform(:Z = last(to(:geometry)), :geometry = shadow(:geometry))
222-
@combine(:Z = first(:Z), :geometry = first(:geometry))
223+
@transform(:z = zcoord(:geometry), :geometry = shadow(:geometry))
224+
@combine(:z = first(:z), :geometry = first(:geometry))
223225
end
224226
```
225227

226-
We perform the interpolation of the "Z" coordinate on the projected centroids of the blocks:
228+
We perform the interpolation of the `z` coordinate on the projected centroids of the blocks:
227229

228230
```{julia}
229231
centroids = unique(shadow.(centroid.(blocks)))
230232
231-
ztable = ztable |> Select("Z") |> Interpolate(centroids, IDW())
233+
ztable = ztable |> Select("z") |> Interpolate(centroids, IDW())
232234
```
233235

234236
```{julia}
235237
ztable |> viewer
236238
```
237239

238-
Finally, we can filter the blocks for which the "Z" coordinate is below the terrain:
240+
Finally, we can filter the blocks for which the `z` coordinate is below the terrain:
239241

240242
```{julia}
241243
p(h) = shadow(centroid(h))
242-
Z(h) = last(to(centroid(h)))
244+
z(h) = zcoord(centroid(h))
243245
244-
zdict = Dict(ztable.geometry .=> ztable.Z)
246+
zdict = Dict(ztable.geometry .=> ztable.z)
245247
246-
active = findall(h -> Z(h) < zdict[p(h)], blocks)
248+
active = findall(h -> z(h) < zdict[p(h)], blocks)
247249
248250
blocks = view(blocks, active)
249251
```

0 commit comments

Comments
 (0)