Datasette plugin that shows a cluster map for any data with latitude/longitude columns
Project description
datasette-cluster-map
A Datasette plugin that detects tables with latitude
and longitude
columns and then plots them on a map using Leaflet.markercluster.
Demo
https://datasette-cluster-map-demo.now.sh/ hosts a demo of this plugin running against several different tables.
Installation
Run pip install datasette-cluster-map
to add this plugin to your Datasette virtual environment. Datasette will automatically include the plugin if it is installed in this way.
If you are deploying using the datasette publish
command you can use the --install
option:
datasette publish now mydb.db --install=datasette-cluster-map
If any of your tables have a latitude
and longitude
column, a map will be automatically displayed.
If you columns are called something else you can still get the map to display by using a custom SQL query to alias those columns to latitude
and longitude
, for example:
select name, lat as latitude, lng as longitude from my_table
How I deployed the demo
I deploy this demo using the latest master versions of both datasette and datasette-cluster-map like so:
datasette publish now --branch=master \
--install=https://github.com/simonw/datasette-cluster-map/archive/master.zip \
--extra-options "--page_size=500" \
polar-bears.db sf-trees.db
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for datasette-cluster-map-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895e623374c3c6f45791640a464229ada4e14033ab0dc0beadd64f5a5f9be9f0 |
|
MD5 | 42f316ab4e300e1ab649c3572c130f3a |
|
BLAKE2b-256 | f9f77549196bcedd6b92b4201c07c263202bbaea4f8a944a41f722ab781b50bd |