Created
October 21, 2017 09:21
-
-
Save edzer/381dac079ddcd5174be31209675b3822 to your computer and use it in GitHub Desktop.
stars -> sf for affine raster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stars) | |
library(sf) | |
geomatrix = system.file("tif/geomatrix.tif", package = "stars") | |
x = st_stars(geomatrix) | |
st_dimensions(x) | |
## from to offset delta geotransform | |
## x 1 20 1841002 1.5 1841000, 1.5, -5, 1144000, -5, -1.5 | |
## y 1 20 1144003 -1.5 1841000, 1.5, -5, 1144000, -5, -1.5 | |
## refsys point values | |
## x +proj=utm +zone=11 +datum=WGS84 +units=m +no_defs TRUE NULL | |
## y +proj=utm +zone=11 +datum=WGS84 +units=m +no_defs TRUE NULL | |
library(sf) | |
## Linking to GEOS 3.5.1, GDAL 2.1.2, proj.4 4.9.3, lwgeom 2.3.1 r15264 | |
s = st_as_sf(x, as_points = FALSE) | |
plot(s, axes =TRUE) |
Author
edzer
commented
Oct 21, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment