Skip to content

Commit

Permalink
Use geometry.MakeValid() for #343
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Mar 22, 2024
1 parent 3900f03 commit 0f5510b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/SDA-spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -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;
"
},
Expand Down Expand Up @@ -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;
"
},
Expand All @@ -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;
",

Expand Down

0 comments on commit 0f5510b

Please sign in to comment.