Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7129193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:13:02+00:00 2026-05-28T11:13:02+00:00

Given an MKMapView that contains a variable amount of annotations ( [mapView annotations] )

  • 0

Given an MKMapView that contains a variable amount of annotations ([mapView annotations]) at various points on the map and the MKMapRect value MKMapRectWorld, how can I determine an area on the map that has the greatest concentration on MKAnnotation objects (perhaps the 5-15 annotations closest to one another) ?

Example scenarios:

* Coffee finder: Determine which area of the map has the most Starbucks

* K9 statistics: Determine which area of the map has the most Cocker Spaniels

The “area” could be a set rect size or determined by a block of annotations, I don’t necessarily care. Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:13:02+00:00Added an answer on May 28, 2026 at 11:13 am

    You will find related question helpful.

    Also take look at K-means_algorithm

    K-means_algorithm
    

    If you have N annotations and want to break into K parts you can find center (which will fill certain criteria. e.g. minimize the within-cluster sum of squares ) of each of K parts with K-means-algorithm. Once you have center find out distance between center and annotation farthest from center it will give radius of region you are interested. There are several variations of K-means_algorithm, you can choose whichever based on performance and ease of implementation.

    EDIT:
    I have not implemented following, but think will definitely give one of solution

    If you are OK with range 5-10, there can be multiple solutions. So we will find one of solution.

    1- Say you have (N=100) annotations and want which (P =15) of them are most located densely.

    2- Then we will divide N annotations in K = N/P groups(here K = 7) randomly

    3- Use K-means algorithm so that finally we will have K groups that can be differentiated as separate entities.

    4- These K groups will have property of minimum ” within-cluster sum of squares”.

    5- If you want to save computational time, you can relax definition of most concentrated group as minimum “within-cluster sum of squares” as opposed to area bounded by them.

    6- select a group from obtained K group that satisfies your criteria.

    7- If want to persist to minimum area(greatest concentration) definition then you will need to do lots of computation

    a. First determine boundary annotations of given group, which itself a huge problem.

    b. calculate are of each polygon and see which is least. not complicated but computationally demanding)

    EDIT2:

    I tried whatever I can and finally thought it this question belongs to specialist math website. I asked your question here and from the answer , you can get paper discussing this problem and solution here. Problem they discuss is given N points, find the K points whose area of convex hull is minimum.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working to implement MapView for the given gpx file to show way points
I have a mapview in my appn. I show some points on the map
i want to know if i can see place on map-MKMapView- by entering the
I created an app that displays different points on a custom map with custom
Given a specific DateTime value, how do I display relative time, like: 2 hours
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I'm trying to update an MKMapView by removing all annotations outside the visible area,
I've got a mapview that I want to put some markers on top of.
I've got an app that caches a pretty decent amount of data in memory
My app is using a ListFragment on left side that the user can use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.