Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in S2PolygonBuilder #4

Open
GoogleCodeExporter opened this issue Sep 28, 2015 · 0 comments
Open

Bug in S2PolygonBuilder #4

GoogleCodeExporter opened this issue Sep 28, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Add the following test to s2polygonbuilder_test.cc:

TEST(S2PolygonBuilder, Basic) {
  std::vector<uint64> cell_ids({1152921504606846976ULL,   
                                3458764513820540928ULL,
                                5764607523034234880ULL,  
                                8070450532247928832ULL,
                                10376293541461622784ULL, 
                                12682136550675316736ULL});
  S2PolygonBuilder builder(S2PolygonBuilderOptions::DIRECTED_XOR());
  for (uint64 val : cell_ids) {
    S2Loop cell_loop{S2Cell(S2CellId(val))};
    builder.AddLoop(&cell_loop);
  }
  S2Polygon polygon;
  ASSERT_TRUE(builder.AssemblePolygon(&polygon, NULL));
  ASSERT_GT(polygon.num_loops(), 0);   // <- fails here
}

The test fails though at it should pass since those s2cells have boundary.
it seems that the builder does not handle properly the adding of edges.

Original issue reported on code.google.com by ro...@ubimo.com on 20 May 2013 at 6:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant