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
NCDFSG Functionality #30
Conversation
R/FromNCDFSG.R
Outdated
#' | ||
#'@importFrom ncdf4 nc_open nc_close ncvar_get ncatt_get | ||
#'@importFrom sp Polygon Polygons SpatialPolygons SpatialPolygonsDataFrame CRS Line Lines SpatialLines SpatialLinesDataFrame SpatialPointsDataFrame | ||
#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an @return would probably be useful here to describe the sp object coming out of this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add.
R/FromNCDFSG.R
Outdated
checkVals <- checkNCDF(nc) | ||
|
||
instance_id<-checkVals$instance_id | ||
instanceDim<-checkVals$instanceDim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a determined style for this package? The mixing of under_score and camelCase variables is a bit disorienting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed... I don't think one has been decided on, but I've been following tidyverse elsewhere. So underscores. I'll do some find and replace action.
R/FromNCDFSG.R
Outdated
variable_list <- checkVals$variable_list | ||
crs <- checkVals$crs | ||
|
||
line<-FALSE; poly<-FALSE; point<-FALSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability, I'd avoid this formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
R/FromNCDFSG.R
Outdated
} | ||
|
||
if(poly) { | ||
SPGeom <- SpatialPolygonsDataFrame(SpatialPolygons(Srl, proj4string = CRS("+proj=longlat +datum=WGS84")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for points you use the prj from the netCDF, but poly and lines are forced into WGS84?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh good catch. The projection stuff was the last thing I added and I missed it down here!
Now that the NetCDF-CF geometry contribution is about done, I figured I'd bring this work over here. There are now two vignettes in the package that show how to use the core functionality.