5

Can someone enlighten me if there is a difference between initializing a CRS object using the EPSG code versus just the +proj string read from a shapefile?

Consider the following objects:

A SpatialPolygonsDataFrame read in from a .shp using readOGR, no additional arguments. I was handed this data.

> itcs[[1]]@proj4string
CRS arguments:
 +proj=utm +zone=17 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 

A lidR tile:

tile<-readLAS(paste("../data/2015/cropped_",fname,sep=""))
tile@crs<-CRS("+init=epsg:32617")
> tile@crs
CRS arguments:
 +init=epsg:32617 +proj=utm +zone=17 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 

To me, these should have the same coordinate system, that is, they have the same projection, zone, datum, ellipsoid and units. One already had a coordinate system, one was assigned using the EPSG code. When plotted they appear to be misprojected, overlapping, but skewed and non-aligned. I'm trying to track down the source of this misprojection.

Perhaps similar here why is there a difference between using EPSG and using basic code

  • 3
    I bet that the data that's assigned a coordsys is not really in that coordinate system, 32617. – mkennedy Apr 27 '18 at 22:15
  • As @mkennedy said, it sounds like one of the datasets has been assigned the wrong spatial reference, the data has coordinates possibly state plane, Albers, Lamberts or NAD.. or one of many others but has been assigned WGS84 UTM Zone 17 north. Go back to where you got the data from, check their metadata and ask the custodian. Guessing what it really is is dodgy and time consuming; it's kind of hard to tell when you're close whether you have the right projection info but the data is misaligned due to inaccuracy. – Michael Stimson Apr 28 '18 at 1:24
  • thanks for the thoughts, trying to rule out one thing at a time. – bw4sz Apr 28 '18 at 2:05
3

Your las file has been recorded in a given CRS. If this CRS is correctly recorded into the file, readLAS is expected to find it from the EPSG code.

Here you set manually the CRS. However this is only added as a metadata and not used internally (yet). If your point cloud is not aligned with your shapefile it means that at least one of your CRS is not the good one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.