From 0f5510b57dd07403120cd36383a55930f78be32f Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Fri, 22 Mar 2024 09:02:00 -0700 Subject: [PATCH] Use `geometry.MakeValid()` for #343 --- R/SDA-spatial.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/SDA-spatial.R b/R/SDA-spatial.R index b92577bf..f9bf2173 100644 --- a/R/SDA-spatial.R +++ b/R/SDA-spatial.R @@ -65,7 +65,7 @@ processSDA_WKT <- function(d, g='geom', crs = 4326, p4s = NULL, as_sf = TRUE) { SELECT geom.STAsText() AS geom, mukey, GEOGRAPHY::STGeomFromWKB( - geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).STArea() * 0.000247105 AS area_ac + geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).MakeValid().STArea() * 0.000247105 AS area_ac FROM geom_data; " }, @@ -95,7 +95,7 @@ FROM geom_data; SELECT geom.STAsText() AS geom, mukey, GEOGRAPHY::STGeomFromWKB( - geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).STArea() * 0.000247105 AS area_ac + geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).MakeValid().STArea() * 0.000247105 AS area_ac FROM geom_data; " }, @@ -122,7 +122,7 @@ FROM geom_data; ) SELECT geom.STAsText() AS geom, areasymbol, -GEOGRAPHY::STGeomFromWKB(geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).STArea() * 0.000247105 AS area_ac +GEOGRAPHY::STGeomFromWKB(geom.STUnion(geom.STStartPoint()).STAsBinary(), 4326).MakeValid().STArea() * 0.000247105 AS area_ac FROM geom_data; ",