Skip to main content

anycluster provides Server-Side clustering of map markers for Geodjango

Project description

anycluster (POSTGIS version)

anycluster provides Server-Side clustering of map markers for Geodjango. It is suitable for large amounts of markers. Depending on your server and personal feeling, it works very well with 200.000 to 500.000 markers.

The postgis version is recommended. There is a mysql version with limited functionality: https://github.com/biodiv/anycluster-mysql

ChangeLog

  • [09.09.2019] support for Django 2.x and above (python 3), added leaflet support
  • [08.10.2015] major code improvements
  • you now need to add {% csrf_token % } somewhere in your template

Features

This application offers 2 methods of clustering:

  • grid-based clustering
  • clustering based on geometric density of the points (needs PSQL extension)
  • cluster contents of any geographic area defined as Polygon/Multipolygon
  • get all elements contained in a cluster

... and has a builtin caching mechanism: if the user pans a map, only the new areas are processed.

And lots of optional customization possibilities:

  • works with google maps and Leaflet
  • define what happens if you click on a cluster
  • use your own cluster graphics
  • define gridsize and other cluster parameters
  • apply filters to your clusters
  • use specialized markers/pins if count is 1

Documentation

http://anycluster.readthedocs.org/en/latest/

Using the Demo

To use the demo, follow these steps:

  • install Django 2.x correctly
  • install psycopg2
  • copy the demo folder to your system and include the anycluster folder as a django app.
  • modify the database connection in settings.py according to your setup
  • if you want to use google maps: add your google api key to anymap/templates/base.html
  • remember to create the kmeans function as described in the documentation
  • from within the demo folder, run python manage.py migrate
  • from within the demo folder, run python manage.py filldemodb 50000 to fill the database with 50000 points
  • be patient, as this process is not very effective
  • from within the demo folder, run python manage.py runserver 8080
  • open your browser and enter localhost:8080

Performance Tips

  • index your GIS database columns correctly
  • usage of a SSD can be 10-20 times faster compared to HDD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anycluster-0.2.tar.gz (49.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anycluster-0.2-py3-none-any.whl (52.9 kB view details)

Uploaded Python 3

File details

Details for the file anycluster-0.2.tar.gz.

File metadata

  • Download URL: anycluster-0.2.tar.gz
  • Upload date:
  • Size: 49.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for anycluster-0.2.tar.gz
Algorithm Hash digest
SHA256 b09559dca3b4946dfb497dc121d43dc01f0144cfcc4a9b0d6b91a098b7b13112
MD5 035d8d9103a8a7a7e30af279653a606a
BLAKE2b-256 702f05353808c844a6b5058b0abd643395e5f38e6ecf1ca0e04f7dbd1ddf9210

See more details on using hashes here.

File details

Details for the file anycluster-0.2-py3-none-any.whl.

File metadata

  • Download URL: anycluster-0.2-py3-none-any.whl
  • Upload date:
  • Size: 52.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for anycluster-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9fbee2666fdbbd98f6c2a2a1befe6c3d05d5416d7706859a53711ddc281f5f4
MD5 17e5295024764c23c3a23d5a5c1a6f54
BLAKE2b-256 fe64ee8b6b16a9c761496015e0427c4a55de2ac9019740ce55c437b73beb5cbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page