S2BufferOperation calculation results are not as expected #319
Replies: 2 comments
-
You're buffering with 50 radians so it's probably generating a full polygon
for you. Maybe try S1Angle::Degrees(buffer_radius)? Also is there a
reason S2Cap won't work?
…On Wed, Jun 28, 2023 at 2:29 AM Liqf ***@***.***> wrote:
I want to get a buffer with a specified point and a specified radius,My
code is as follows
double lat = 100;
double lng = 2;
double buffer_radius = 50;
S2BufferOperation::Options options;
options.set_buffer_radius(S1Angle::Radians(buffer_radius));//specified buffer_radius
auto output = std::make_unique<S2Polygon>();
S2BufferOperation op(std::make_unique<s2builderutil::S2PolygonLayer>(output.get()), options);
op.AddPoint(S2LatLng::FromDegrees(lat, lng).ToPoint());
S2Error error;
if(!op.Build(&error)){
//这里应该返回报错
return nullptr;
}
There is a loop in the output output, this loop num_vertices = 1;
Is there something wrong with my code?
—
Reply to this email directly, view it on GitHub
<#319>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEMKUUY5V35IJ4PHB3BXTXNPTNRANCNFSM6AAAAAAZWVY4PU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I try to S2Earth::MetersToAngle(buffer_radius) options.set_circle_segments(8);// the result is correct. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to get a buffer with a specified point and a specified radius,My code is as follows
There is a loop in the output output, this loop num_vertices = 1;
Is there something wrong with my code?
Beta Was this translation helpful? Give feedback.
All reactions