Skip to main content

Tag Clustering for Tag Maps

Project description

Tag Maps

Spatio-Temporal Tag and Photo Location Clustering for generating Tag Maps

Tag Maps are similar to Tag Clouds, but Tag Maps use the spatial information that is attached to geotagged photographs, in addition to tag frequency, to visualize tags on a map. This Library uses the single-linkage tree that is available from HDBSCAN to cut trees at a specific user-defined distance for all available tags in the given dataset. Afterwards, Alpha Shapes are generated as a means to 'soft' placement of tags on a map, according to their area of use. Two Shapefiles are generated that can be used to visualize maps, for example, in ArcGIS.

Tag Map Example

Installation

  1. The easiest way for Windows users is to download the newest pre-compiled build from releases and run tagmaps.exe
  2. For all other OS, the reccommended way is to install with pip install tagmaps

Run

  1. Place geotagged data in /01_Input subfolder
    • example files/format are available in the pre-compiled build zip-file above
  2. Output files will be saved in /02_Output (2 Shapefiles in auto-selected UTM projection, one containing all tag cluster and one with the overall location clusters)
  3. Visualize Shapefiles using ArcGIS (I haven't tried other GIS Software such as QGIS, but it should theoretically be possible..)
    • download BasemapLayout_World.mxd from resources folder and replace missing links with 2 resulting Shapefiles in /02_Output
    • adjust minimum and maximum Font Sizes, Weighting Formula or other metrics to your needs.

Code

The code has been completely refactored in January 2019, but there are still some missing pieces. Particularly the API (that is: import tagmaps) is not fully implemented. See method main() in main.py for examples on how to use tag maps package.

Resources

  • Check out this album on Flickr with some more Tag Maps examples
  • There's also an semi-interactive interface to explore some Tag Maps here
  • Check out my blog here with some background information

Contributors

Some future goals:

  • include topic modeling
  • improve automatic detection of general vs specific tags for an area
  • include mapping/visualization step (replace ArcGIS)

Built With

This project includes and makes use of several other projects/libraries/frameworks:

Alpha Shapes Kevin Dwyer/ Sean Gillies

Generating Concave Hull for Point Clouds

HDBSCAN McInnes, J. Healy, S. Astels - BSD licensed

A high performance implementation of HDBSCAN clustering.

Shapely

Manipulation and analysis of geometric objects

SciPy and Convex Hull

Simple shapes for point clusters are generated using SciPy's excellent Convex Hull functions

Fiona

OGR's neat and nimble API for Python programmers.

License

GNU GPLv3

Changelog & Download

2019-02-06: TagMaps v0.13.0

  • First version of public API, e.g. load tagmaps to other packages with import tagmaps or from tagmaps import TagMaps
  • LoadData with contextmanager/ pipeline generator
  • Refactor of LoadData and PrepareData in two separate classes

2019-01-23: TagMaps v0.11.1

  • complete refactor of code with improved encapsulation, code now largely follows PEP conventions
  • bugfix: emoji handling now accurately recognizes grapheme clusters consisting of multiple unicode codepoints.
  • interface: add feature to filter based on toplists for tags, emoji and locations
  • added sample CC-BY dataset

2018-01-31: TagMaps v0.9.2

  • Because Tag Maps can be generated from local to regional to continental scale, finding an algorythm that fits all was not straight forward. The current implementation will produce shapes for all of these scales without any user input.
  • This Final Alpha Shape Implementation is motivated from Kevin Dwyer/ Sean Gillies great base code
  • Implementation of Auto-Projection from Geographic to Projected Coordinate System. The code will select the most suitable UTM Zone for projecting data.

2018-01-17: TagMaps v0.9.1

  • First build
  • Initial commit, still lots of unnecessary comments/code parts left in code

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

tagmaps-0.13.1.tar.gz (407.1 kB view hashes)

Uploaded Source

Built Distribution

tagmaps-0.13.1-py3-none-any.whl (77.2 kB view hashes)

Uploaded Python 3

Supported by

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