Skip to content

Commit

Permalink
spatial_crs_coding: replace proj4string<- by slot(, "proj4string")<- *
Browse files Browse the repository at this point in the history
This applies the request by Roger Bivand in r-spatial/discuss#43 (comment).
Apologies for this late update.
  • Loading branch information
florisvdh committed Jan 31, 2022
1 parent 5a8feb3 commit a0f49eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/tutorials/spatial_crs_coding/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,10 @@ coordinates(cities2) <- ~ X + Y
Now, we can add a CRS:

```{r}
proj4string(cities2) <- crs_wgs84
slot(cities2, "proj4string") <- crs_wgs84
```

Note the name of the `proj4string<-` replacement function in `sp`: it still reminds of old days, but the result is GDAL3/PROJ≥6 compliant!
Maybe we'll get another function in the future that cuts the link with the 'proj4string' name.
Note the name of the `proj4string` slot in `cities2`: it still reminds of old days, but the result is GDAL3/PROJ≥6 compliant!


#### Get the CRS of a `Spatial*` object in `sp`
Expand Down

0 comments on commit a0f49eb

Please sign in to comment.