Skip to content

Commit

Permalink
Update rmdnote on geometry col name
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Oct 28, 2017
1 parent 9264d08 commit 979b8b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions 03-attribute-operations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ Many of these functions, including `rbind()` (for binding rows of data together)
A key feature of `sf` objects is that they store spatial and non-spatial data in the same way, as columns in a `data.frame` (the geometry column is typically called `geometry`).

```{block2 type = 'rmdnote'}
It is important to note that the geometry column of an `sf` object is typically called `geometry`.
However, `sf`-objects imported from a spatial database might have names such as `wkb_geometry`, `the_geog` or `the_geom`.
Additionally, an R user can rename the geometry column of an `sf` object however he/she likes.
The geometry column of `sf` objects is typically called `geometry` but any name can be used.
The following command, for example, creates a geometry column named `g`:
`st_sf(data.frame(n = world$name_long), g = world$geom)`.
This enables geometries imported from spatial databases to have a variety of names such as `wkb_geometry`, the_geog` and `the_geom`.
```

`sf` objects also support `tibble` and `tbl` classes used in the tidyverse, allowing 'tidy' data analysis workflows for spatial data.
Expand Down

1 comment on commit 979b8b6

@Nowosad
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Please sign in to comment.