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

getClusters returns empty list when specified area crosses 180°E/W #13

Open
LincolnPuzey opened this issue Feb 20, 2024 · 0 comments
Open

Comments

@LincolnPuzey
Copy link

When the specified area to getClusters crosses 180°E/W, no clusters are returned.
(e.g. left side = 170°E and right side = 170°W)

I have adapted the example in the README to show the problem.

import numpy
import pysupercluster

# some points near 180°E/W 1°N
points = numpy.array([
    (179.9900, 1.0001),
    (-179.8800, 1.0005),
    (179.9950, 1.0009),
    (-179.9910, 1.0003),
])
index = pysupercluster.SuperCluster(
    points,
    min_zoom=0,
    max_zoom=16,
    radius=40,
    extent=512,
)
clusters = index.getClusters(
    # area that covers all the points and crosses 180°E/W
    top_left=(170, 10),
    bottom_right=(-170, -10),
    zoom=4,
)
print(clusters)  # [] returned when there should be clusters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant