Skip to content
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

Wrong check on WGS84-based projected coordinate systems #79

Open
lucarraro opened this issue Feb 9, 2023 · 1 comment
Open

Wrong check on WGS84-based projected coordinate systems #79

lucarraro opened this issue Feb 9, 2023 · 1 comment

Comments

@lucarraro
Copy link

In the CRAN version of this package, there seems to be a problem when prj identifies a WGS84-based UTM coordinate system. elevatr somehow expects a longitude value from -180 to 180, even if coordinates are projected and hence not given in degrees.

The following command fails (EPSG= 32632 stands for WGS 84 / UTM zone 32N):

get_elev_raster(data.frame(x=c(320000, 475000), y=c(5060000, 5180000)), prj = "EPSG:32632", z = 9)

The issue does not arise when ED50-based projections are used. The following command works (EPSG = 23032 stands for ED50 / UTM zone 32N):

get_elev_raster(data.frame(x = c(320000, 475000), y = c(5060000, 5180000)), prj = "EPSG:23032", z = 9)

The issue is apparently due to loc_check checking whether the crs string contains 4326 (in particular: grepl("\\b4326\\b", st_crs(prj_test))).

I noticed that this issue is fixed in the current GitHub version of the package. It would be great if you could also upload the CRAN version.

@jhollist
Copy link
Owner

@lucarraro Sorry for the delay in responding. I have a few fixes in the works and am hoping to push a CRAN version sometime in the next week or so. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants