USGS-R / inlmisc

Miscellaneous Functions for the USGS INL Project Office
Other
21 stars 5 forks source link

Error in createPolygonsComment(p) when using PlotCrossSection #149

Closed jsacerot closed 1 year ago

jsacerot commented 1 year ago

@jfisher-usgs I know some spatial libraries are(will) unavailable, which may cause issues with this package. However, I would like to know if the error I am getting has to do with it and if it is easy to fix:

Error in createPolygonsComment(p) : 
  rgeos_PolyCreateComment: orphaned hole, cannot find containing polygon for hole at index 250

This was my function call:

    PlotCrossSection(transect1, raster::stack(DEM, KWHM_stack[[1]][[1:54]], KWHM_stack[[var]][[1:54]]),
                     ylim = ylim,
                     geo.lays = c("LE_m_lyr00", names(KWHM_stack[[1]][[1:54]])),
                     val.lays = names(KWHM_stack[[var]][[1:54]]),
                     breaks = breaks,
                     ylab = "Elevation, m", asp = asp,
                     id = c("A", "A'"),
                     explanation = paste0(KWHM_vars[var], ", ", KWHM_unit[var]),
                     bg.col = "#E1E1E1",
                     scale.loc = NULL,
                     draw.sep = F,
                     max.dev.dim = c(36, 33),
                     file = paste0(rd, "ParFlow_inputs/Parameters/", KWHM_vars[var], "_KWHM_AAtest'.png"))

Thanks!