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

NCDFSG Functionality #30

Merged
merged 5 commits into from Aug 1, 2017
Merged

Conversation

dblodgett-usgs
Copy link
Collaborator

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+15.7%) to 87.603% when pulling 3ee49d8 on dblodgett-usgs:master into ef923f8 on USGS-R:master.

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
#'

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

Copy link
Collaborator Author

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

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.

Copy link
Collaborator Author

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

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.

Copy link
Collaborator Author

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")),

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?

Copy link
Collaborator Author

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!

@coveralls
Copy link

Coverage Status

Coverage increased (+14.6%) to 86.42% when pulling 76626c7 on dblodgett-usgs:master into ef923f8 on USGS-R:master.

@dblodgett-usgs dblodgett-usgs merged commit 0600a0c into DOI-USGS:master Aug 1, 2017
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

Successfully merging this pull request may close these issues.

None yet

3 participants