gge-ucd / Discussion

Class discussion for R-DAVIS course
0 stars 4 forks source link

Projection and data in two different units #24

Closed ecbolas closed 7 years ago

ecbolas commented 7 years ago

Hi All, I welcome feedback from anyone on this one:

I have data that has a projection in NAD 83/utms : crs(fox_grids) +proj=utm +zone=11 +datum=NAD83+units=m +no_defs +ellps=GRS80+towgs84=0,0,0

But, the coordinates are clearly in decimal degrees (lat/long): fox_grids@data type ident Latitude Longitude 1 WAYPOINT 1 34.04629 -119.5679

So, this is really confusing to me, clearly I don't understand projections as well as I thought I did! How can you have a projection in one set of units, but the actual data in another? Thanks @ryanpeek @Myfanwy and others!

ryanpeek commented 7 years ago

Forgot to mention, I posted a pdf in the documents (https://github.com/gge-ucd/wRangling_Seminar/blob/master/documents/OverviewCoordinateReferenceSystems_R.pdf) that has some nice overview and commands for dealing with projections.

And I suspect if you look at the fox_grids@coordinates slot in your spatial data frame, you'll find your coordinates are UTMs...your fox_grids@data is simply your data frame (which may include decimal degrees or utms or whatever you choose to have in there...it can be both as long as you know which CRS is being used for each. But your spatial data is in UTM NAD83...so that is what the map will be using to plot things if you are using the spatial polygon/lines/points/raster.

ecbolas commented 7 years ago

thank you!!!