You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am wondering if there is any example on how to perform polygon offsetting.
I have a double[][] array with the polygon vertices points in clockwise order and I want to inflate it by 2mm.
Is there any example code on how to perform the offseting ?
@stolstov I tried your example. For a 16 vertices polygon I get 104vertices after I inflate it :)
Is there a way to make the inflated polygon a bit... smaller ?
Perhaps I have to use the OperatorOffset.local().execute instead of OperatorBuffer.local().execute. All I want is to make an outline border outside of a polygon.
On the left you can see the buffer in blue color. On the right I marked the initial curves as they were "extended".
Is it possible to get the X,Y start and X,Y end of the initial curves after I buffer a polygon ?
I do not need the other points.
@stolstov I see.. The reason I need the original vertices after they are buffered is because some polygons has Arcs.
I was hopping to split the arc to 3 points and after the buffering, recovering the arc from the 3 initial points.
In some more complicated cases the arcs intersect with each other and only partial. That happens when the polygon border has a lot of details and the buffer width is large.
I managed to inflate a polygon with arcs. I split arc into small linear segments and I use the points to form a polygon.
It works fine on all of my tests. Do you think there is a way to convert points back to arcs ?
Activity
randallwhitman commentedon Jun 2, 2022
Hi @nsiatras - take a look at GeometryEngine.buffer / OperatorBuffer .
stolstov commentedon Jun 2, 2022
@nsiatras Is this the behavior that you want? http://esri.github.io/geometry-api-java/doc/Buffer.html
If yes, then this is a sample code:
nsiatras commentedon Jun 2, 2022
Thank you all for your replies.
@stolstov I tried your example. For a 16 vertices polygon I get 104vertices after I inflate it :)
Is there a way to make the inflated polygon a bit... smaller ?
nsiatras commentedon Jun 2, 2022
PS this is my polygon
(com.esri.core.geometry.Polygon) {"rings":[[[25,20],[20,25],[20,55],[25,60],[55,60],[60,55],[60,25],[55,20],[25,20]]]}
nsiatras commentedon Jun 2, 2022
Perhaps I have to use the OperatorOffset.local().execute instead of OperatorBuffer.local().execute. All I want is to make an outline border outside of a polygon.
nsiatras commentedon Jun 4, 2022
Hello again,
I managed to buffer a polygon.

On the left you can see the buffer in blue color. On the right I marked the initial curves as they were "extended".
Is it possible to get the X,Y start and X,Y end of the initial curves after I buffer a polygon ?
I do not need the other points.
Thank you in advance
stolstov commentedon Jun 6, 2022
@nsiatras Buffer operation does not remember the original vertices, so there is no way to obtain those directly from the buffer polygon.
nsiatras commentedon Jun 8, 2022
@stolstov I see.. The reason I need the original vertices after they are buffered is because some polygons has Arcs.
I was hopping to split the arc to 3 points and after the buffering, recovering the arc from the 3 initial points.
stolstov commentedon Jun 8, 2022
In some more complicated cases the arcs intersect with each other and only partial. That happens when the polygon border has a lot of details and the buffer width is large.
nsiatras commentedon Jun 8, 2022
I managed to inflate a polygon with arcs. I split arc into small linear segments and I use the points to form a polygon.
It works fine on all of my tests. Do you think there is a way to convert points back to arcs ?