-
Notifications
You must be signed in to change notification settings - Fork 7
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
NaN coordinates in sites_base and sites_over when using legacy_sites with grts() #40
Comments
Thanks @nstauffer . I believe the bug occurs here because the geometry column name is not sf::st_geometry(strata) <- "geometry" See here for more. We do plan to fix this bug in the next CRAN submission (and allow for arbitrary geometry names), but I will leave the issue open until we push a fix. |
That worked like a charm, thanks! I try to be vigilant for that particular issue because it often gives me heartburn trying to combine sf objects, but it didn't cross my mind this time. |
@nstauffer one other note: see |
… geometry column name different from geometry and legacy_sites was specified #40.
@nstauffer We have implemented a more permanent solution, which is available in the development version of devtools::install_github("USEPA/spsurvey", ref = "develop") This bug fix will be included in the next CRAN submission (the current version of CRAN is 5.5.0). |
@nstauffer The fix is now on CRAN. |
I've been trying to use the legacy sites argument to balance a set of points around another set of points, e.g., taking an existing sampling design in an area as legacy points and drawing a new design including all those legacy points plus new points then keeping only the new points as a supplemental design. But! I've run into an issue where using
legacy_sites
results in the output looking normal, but the lat_WGS84 and lon_WGS84 variables inoutput$sites_base
andoutput$sites_over
are allNaN
.There are no outright errors reported, but I get the following warnings which appear to have to do with identifying the extent of the bounding box for one of the spatial objects.
This happens regardless of if I'm stratifying or not and I've done everything I can to make sure there are no geometry errors or irregularities in the polygons with both
sf::st_buffer()
andsf::st_make_valid()
. I also get numeric values as expected from both my frame and legacy sites when usingsf::st_bbox()
. And I can get it to produce valid points as long as I don't uselegacy_sites
. I've gone rooting around to see if I can identify where things are going sideways withingrts()
but haven't been able to turn up a starting point.The attached file contains a geodatabase with the polygons I've been using. Below should produce the warnings and the wonky, coordinate-less outputs.
The text was updated successfully, but these errors were encountered: