Closed erikarasnick closed 2 years ago
use st_make_valid on all polygons before saving the rds file to s3, then use this new version of the file in the container.
st_make_valid
rds
st_join will fail for a point when largest = TRUE if a nearby geometry is not valid (i.e. contains a self-intersecting ring).
st_join
largest = TRUE
example <- tibble::tribble( ~location_id, ~address, ~start_date, ~end_date, ~lat, ~lon, ~score, ~precision, ~geocode_result, 1090960, "302 SMITH DR FORT WALTON BEACH FL 32548", "4/19/10", "7/1/10", 30.417158, -86.595944, 0.886, "range", "geocoded" )
If largest = FALSE, the one overlapping tract shown above is chosen with no error.
largest = FALSE
If largest = TRUE, the large polygon above is (apparently...) included for consideration, and this polygon is not a "valid" polygon.
st_is_valid(all_tracts$`2010`[all_tracts$`2010`$census_tract_id == "12091020800",], reason = TRUE) [1] "Ring Self-intersection[894508.042800001 865389.710577341]"
@cole-brokamp Not exactly what I thought was going on, but I think I can fix it!
To Do:
use
st_make_valid
on all polygons before saving therds
file to s3, then use this new version of the file in the container.Background
st_join
will fail for a point whenlargest = TRUE
if a nearby geometry is not valid (i.e. contains a self-intersecting ring).If
largest = FALSE
, the one overlapping tract shown above is chosen with no error.If
largest = TRUE
, the large polygon above is (apparently...) included for consideration, and this polygon is not a "valid" polygon.