Skip to content

Commit

Permalink
closes #1017
Browse files Browse the repository at this point in the history
  • Loading branch information
Nowosad committed Jun 7, 2024
1 parent ca2783e commit 3881355
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions 04-spatial-operations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ We will create additional geometries to demonstrate spatial relations with the f
Note the use of the function `st_as_sf()` and the argument `coords` to efficiently convert from a data frame containing columns representing coordinates to an `sf` object containing points:

```{r}
line_sfc = st_sfc(st_linestring(cbind(
x = c(0.4, 1),
y = c(0.2, 0.5)
)))
# create points
point_df = data.frame(
x = c(0.2, 0.7, 0.4),
y = c(0.1, 0.2, 0.8)
Expand All @@ -212,7 +207,6 @@ point_sf = st_as_sf(point_df, coords = c("x", "y"))
```{r relation-objects, echo=FALSE, fig.cap="Points, line and polygon objects arranged to illustrate topological relations.", fig.asp=1, out.width="50%", fig.scap="Demonstration of topological relations."}
par(pty = "s")
plot(polygon_sfc, border = "red", col = "gray", axes = TRUE)
plot(line_sfc, lwd = 5, add = TRUE)
plot(point_sf, add = TRUE, lab = 1:4, cex = 2)
text(point_df[, 1] + 0.02, point_df[, 2] + 0.04, 1:3, cex = 1.3)
```
Expand Down

0 comments on commit 3881355

Please sign in to comment.