So, for example, let's say I had the lat/long of 80 different points in Kansas. I need a script that can take those points and group them into, for instance, 8 groups. Those groups need to be optimized for proximity, meaning that each group is grouped around other points that are also nearby. In this example, you'd end up with 10 locations in each grouping, and each group of 10 would be surrounded by the most nearby other locations.
I'm a decent web developer, but this script is beyond my expertise. I need someone to write this script. I'd prefer it was done in Ruby, or possibly Javacript. If there is some other statistical modeling language that would be preferable, that's fine, but I'd need some guidance integrating it into my site.
This script needs to be able to take up to 300 points for any state, and group them in up to 30 groupings. The groupings will be constrained by the boundaries of the particular state. I need to be able to pick a state, upload the coordinate, and run the script.
The result of the script needs to be points, color coded, placed on either a Mapbox or Google map.
That's it! Let me know if you have questions.