How can one obtain one-sided buffer (left/right) of a line geometry in GEE? I haven't found any specific function to do that.
1 Answer
Great question. What you are asking about is called an offset in the world of CAD. In CAD programs, a line can be offset: left, right or both. And a polygon object can be offset : inside, outside, or both.
In GIS, a buffer is a zone that is drawn around any point, line, or polygon that encompasses all of the area within a specified distance of the feature. This zone is drawn by a GIS in the form of a new polygon.[1] So-called 'Negative buffers' may also be used for polygons to specify a distance inward from the boundaries of the area feature.
Say there was a one-sided buffer. Then how would that object interact with other geometric shapes? Think about one-sided buffer in relation to the DE-9IM.
The Dimensionally Extended nine-Intersection Model (DE-9IM).
https://en.wikipedia.org/wiki/DE-9IM
Did you try using the singleSide argument of the st_buffer() function?
g1 <- st_buffer(l1, .5, singleSide = TRUE)
plot(g1)
g2 <- st_buffer(l1, .5, singleSide = FALSE)
plot(g2)
As for the side of the offset, that gets me.
-
I somehow want to 'cut' a polygon into two polygons using a line (see my question here: gis.stackexchange.com/q/368888/33177). That's why I was thinking to do one-sided buffer of the line and then perform intersection. I couldn't figure out a solution from your answer, can you please explain?– shahryarCommented Jul 30, 2020 at 23:13
-
3This looks like r code< not Google Earth Engine javascript.– user2856Commented Jul 31, 2020 at 7:21