You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem when I use a projected CRS (for example EPSG:6372), I want to turn a basedata of species ocurrences into sf object with st_as_sf(), but if I plot that sf object with mapview() doesn't show a map behind the ocurrences
sf object from above basedata
base_sf <- st_as_sf(base_final_spp_focales, coords=c("longitude", "latitude"),
crs=6372)
I also have a shapefile of mexican states, with a projected CRS:
estados_mex
Simple feature collection with 32 features and 9 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 911292 ymin: 319149.1 xmax: 4083063 ymax: 2349615
Projected CRS: LCC_WGS_1984
But when I tried to use the same CRS in the sf object of ocurences basedata (base_sf) I have the same problem, it's weird because I can plot it right with mapview:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a problem when I use a projected CRS (for example EPSG:6372), I want to turn a basedata of species ocurrences into sf object with st_as_sf(), but if I plot that sf object with mapview() doesn't show a map behind the ocurrences
base_final_spp_focales <- read.csv("data/base_unida_spp_focales.csv")
base_sf <- st_as_sf(base_final_spp_focales, coords=c("longitude", "latitude"),
crs=6372)
I also have a shapefile of mexican states, with a projected CRS:
But when I tried to use the same CRS in the sf object of ocurences basedata (base_sf) I have the same problem, it's weird because I can plot it right with mapview:
crs_estados_mex <- st_crs(estados_mex)
chilopsidis_sf <- st_as_sf(chilopsidis, coords=c("longitude", "latitude"),
crs=crs_estados_mex)
I don't kwon why it happens, because if I use crs=4326 I don't have any problem, I checked the basedata for NA but it doesn't have any.
If someone kwons the reason and can help me I will be grateful with you.
Best regards,
erickcdb.
UPDATE:
I solved this problem with:
chilopsidis_sf_proyectado <- st_transform(chilopsidis_sf, crs=3857)
Beta Was this translation helpful? Give feedback.
All reactions