Border Based Marking Clustering

The Food Assembly is a European arrangement which brings together local nutrient producers amongst local consumers. The Food Assembly has created such groups throughout Europe, enabling consumers to come upwards together in addition to purchase locally sourced food.
You tin uncovering your nearest nutrient assembly on the Food Assembly's searchable Mapbox powered map. The map includes a actually interesting mark clustering scheme which groups together nutrient assemblies yesteryear percentage in addition to country.
Nearly all of the existing mark clustering libraries are based on a proximity algorithm which groups together markers purely on their geographical proximity. The occupation amongst this variety of proximity approach to mark clustering is that it ignores administrative in addition to political borders in addition to regions.
For example, using a proximity algorithm or thus markers inwards 'Country A' may last grouped together amongst markers from 'Country B' because they are geographically close, piece other markers inwards 'Country A' may last clustered amongst markers inwards 'Country C' because they are closer geographically to 'Country C' than other markers inwards 'Country A'.
Map users nevertheless are used to province in addition to regional borders. Influenza A virus subtype H5N1 mark clustering solution which groups makers based on province in addition to regional borders may look to a greater extent than natural to the user. In such a mark clustering scheme all the markers inwards 'Country A' volition last inwards i cluster, all the markers inwards 'Country B' volition last inwards a sort out cluster in addition to all 'Country C' markers volition last inwards another. Place these clusters at the centroid of each respective province in addition to the user tin clearly state which markers are inwards which country.
The Food Assembly has developed such a mark clustering solution, clustering markers based on administrative in addition to political borders in addition to regions. At the lowest zoom levels the map clusters markers yesteryear country. Zoom inwards on the map in addition to the markers thus overstep clustered yesteryear region. Only when you lot actually zoom inwards on the map does the Food Assembly switch to a proximity algorithm which ignores administrative borders.