sidewalklabs / s2sphere

Python implementation of the S2 geometry library.
http://s2sphere.sidewalklabs.com/
MIT License
213 stars 44 forks source link

max_cells not respected #30

Closed Prindle19 closed 6 years ago

Prindle19 commented 7 years ago

the max_cells RegionCoverer does not seem to always be respected?

For instance, when set to 5, and when the geometry that I want covered is a long rectangle, I get 10 cells.

screen shot 2017-11-08 at 5 14 19 pm

89c2834,89c283c,89c285,89c28b4,89c28b84,89c28d,89c28f,89c2f4,89c2f9,89c2ff

Prindle19 commented 6 years ago

Hello, is this not an issue?

svenkreiss commented 6 years ago

Sorry, was about to send a message. Btw: thanks for reporting this issue.

The problem was tracked down to the web interface and not the core s2sphere library. The web interface should be fixed now. Let me know if you keep seeing this problem.

Prindle19 commented 6 years ago

Oh, got it.

Just checked the site and it seems to work if you keep the minimum level below 10. However, once the minimum level is 10 and the max is 20, and the max cells is 5, the bug still looks to exist.

svenkreiss commented 6 years ago

The original issue that you filed had a generous min level. This is a bit different now and expected. There is a point when you increase the minimum level (i.e. restrict the maximum size of a cell) where it is impossible to cover the given area with the given number of max cells. In that case, max cells is ignored.