-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set CRS for an arbitrary Euclidean plane #797
Comments
I believe you can set |
I assume @aloboa is referring to raster data, but for vector data it would probably be better to set up some CRS because some operations may not work. library("terra")
v = vect(cbind(0, 0), type = "points", crs = "")
buffer(v, 1)
#> Error: [buffer] crs not defined |
Could use a LOCAL_CS or ENGCRS WKT string to get more specific and reoslve case brought up by @kadyb. Something like: vect(cbind(0, 0), type = "points", crs = 'LOCAL_CS["Cartesian (Meter)",LOCAL_DATUM["Local Datum",0],UNIT["Meter",1.0],AXIS["X",NORTH],AXIS["Y",EAST]]') |
This is actually better, as the "no projection" alternative does not always work (even in QGIS, you can set "No projection (or Unknown/non-Earth projection" in Options/CRS but cannot, eg, create an object with no projection). |
@brownag, why "AXIS["X",NORTH],AXIS["Y",EAST]]", should it not be AXIS["Y",NORTH],AXIS["X",EAST]] ? |
Sorry, that's a typo! No reason |
Thanks for the useful ideas. I have made a few changes to make this easier to use. You can set the crs that @brownag suggests by using the value "local" (see below). I have also made some changes that avoid errors when this crs is used; but please let me know if you find more cases where this can be done. SpatRaster
For area computations you need to use "transform=FALSE"
SpatVector
|
Thanks for taking this suggestion into consideration. |
I expect this to get to CRAN sometime this month. But you can use |
Given
I get:
Is this correct? I expected the dimension to be 10,5,1 as in
|
Perhaps this should return an error:
Because, given the default extent, the combination of rows/columns and resolution is not possible. |
The manual says:
|
I wrongly assumed that in this case
the extent was automatically set to extent=c(0,5,0,10). But I understand you must have good reasons for to define a plot of 5m x 10m and 1m resolution:
and
|
There are default values for xmin, xmax, ymin, ymax, so it would be unexpected to change these based on the value of other arguments. Your use of For example:
|
Is it possible to set an arbitrary Euclidean plane as CRS in terra?
In some cases (eg. relatively small field plots) there is really no standard CRS.
According to
https://gis.stackexchange.com/questions/27699/how-to-represent-an-imaginary-flat-world-in-qgis-without-using-a-round-world-crs
I could use eg. World Mercator, but QGIS has the option of defining No projection by default.
At the moment, any raster with no CRS information is assumed to be lon/lat WGS 84 in terra.
The text was updated successfully, but these errors were encountered: