Skip to content

Commit

Permalink
Finish draft CRS section. Close #53
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Jul 21, 2017
1 parent bb076b6 commit 057f25f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion 02-spatial-data.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,21 @@ To discover what the 'magic number' `27700` means, we can retrieve the CRS again
st_crs(sf_points)
```

Note that the result shows that the `epsg` has been updated to this code.
Note that the result shows that the `epsg` has been updated. But what does this mean?
The answer can be found in another function, from the **rgdal** library:

```{r}
crs_codes = rgdal::make_EPSG()
dplyr::filter(crs_codes, code == 27700)
```

This shows that the CRS we set was the British National Grid.
Although this result could also have been found by searching online for "[CRS 27700](https://www.google.co.uk/search?q=CRS+27700)", or by plotting it with a command such as `mapview::mapview(sf_points)` and zooming out, the method showed above was useful for delving into the nuts and bolts of how EPSG codes work.
The formula that converts a geographic point into a point on the surface of the Earth is provided by the `proj4string` element of the `crs` (see [proj4.org](http://proj4.org/) for further details):

```{r}
st_crs(27700)$proj4string
```

### {-} Pro tip

Expand Down

0 comments on commit 057f25f

Please sign in to comment.