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

Group annotations into one unique location if their distance is within a custom radius distance #77

Open
kuoliangkwong opened this issue Feb 26, 2015 · 3 comments

Comments

@kuoliangkwong
Copy link

Hi,

Is there any way to make annotations to be grouped as one unique location if they are, say, within 50m in radius? I tried using the cellSize but it seems like it's used to clustering annotations.

@choefele
Copy link
Owner

You are right about the cell size.

Locations are considered the same if their geohash is the same (More about geohashes). The code is currently using a geohash length of 9.

While you could make the geohash length a property of the cluster controller, I'm not sure there's an easy way to turn distance in meters into a length value. Otherwise, the geohash length is a bit opaque.

Perhaps you can pre-process your data to cut off significant bits of the coordinate to achieve the same? You could even do this on the server thus saving time on the client.

@kuoliangkwong
Copy link
Author

Is it the one from here? I guess we could just add a property for geohash length. Is it ok we can pull request once we done adding the property?

I tried cutting off the significant bits by rounding down the latitude and longitude to 3 decimal points, but it seems like the location is slightly shifted.

@choefele
Copy link
Owner

choefele commented Mar 3, 2015

Yes, that's what I meant. CCHMapClusterOperation uses anyObject to display unique locations. Basically you'll get a random location from the set.

I'm thinking you might be best off with preprocessing your data so you can define which location is used for nearby locations.

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

2 participants