Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inconsistent column names in NHDPlusv2 #43

Closed
lawinslow opened this issue Feb 22, 2018 · 1 comment · Fixed by #45
Closed

Inconsistent column names in NHDPlusv2 #43

lawinslow opened this issue Feb 22, 2018 · 1 comment · Fixed by #45

Comments

@lawinslow
Copy link
Owner

Causing errors

linked_wb = link_to_waterbodies(44.021168, -88.458919, 'lakeobs1', dataset='nhdplusv2')
 Error in `[.data.frame`(unique_matches, , dinfo$id_column) : 
  undefined columns selected 

Need to make sure this is fixed in the next data release.

@lawinslow
Copy link
Owner Author

@rainshapes I'm still having issues with column names in NHDPlusv2. Capitalization switches across different files, so I continue to get the error mentioned above. Could you take a look at this?

nhdplusfiles = all_shapefiles(check_dl = TRUE, dataset='nhdplusv2', feature_type='waterbody')
allnames = lapply(nhdplusfiles, function(x){names(sf::read_sf(x))})
allnames

[[1]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[2]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[3]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[4]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[5]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[6]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[7]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[8]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[9]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[10]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[11]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[12]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[13]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[14]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[15]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[16]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[17]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[18]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[19]]
 [1] "ComID"      "FDate"      "RESOLUTION" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "Shape_Leng" "Shape_Area" "centroid_x" "centroid_y" "geometry"  

[[20]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[21]]
 [1] "COMID"      "FDATE"      "RESOLUTION" "GNIS_ID"    "GNIS_NAME"  "AREASQKM"   "ELEVATION"  "REACHCODE"  "FTYPE"     
[10] "FCODE"      "SHAPE_LENG" "SHAPE_AREA" "centroid_x" "centroid_y" "geometry"  

[[22]]
 [1] "Permanent_" "FDate"      "Resolution" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "ComID"      "centroid_x" "centroid_y" "geometry"  

[[23]]
 [1] "Permanent_" "FDate"      "Resolution" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "ComID"      "centroid_x" "centroid_y" "geometry"  

[[24]]
 [1] "Permanent_" "FDate"      "Resolution" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "ComID"      "centroid_x" "centroid_y" "geometry"  

[[25]]
 [1] "Permanent_" "FDate"      "Resolution" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "ComID"      "centroid_x" "centroid_y" "geometry"  

[[26]]
 [1] "Permanent_" "FDate"      "Resolution" "GNIS_ID"    "GNIS_Name"  "AreaSqKm"   "Elevation"  "ReachCode"  "FTYPE"     
[10] "FCode"      "ComID"      "centroid_x" "centroid_y" "geometry"  

```R

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant