GithubHelp home page GithubHelp logo

clustr's Introduction

clustr - construct polygons from tagged points
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
written by Schuyler Erle <[email protected]>
(c) 2008 Yahoo! Inc.

Overview
--------
Clustr takes a text file containing longitude/latitude points, tagged with
a bit of text, and attempts to generate minimal polygons that "cover" those
points, using an "alpha" parameter to determine the notion of "coverage".
The polygons are written to an ESRI Shapefile, suitable for use in GIS
software.

Building clustr
---------------
You will need to have the GDAL library (http://www.gdal.org/) installed,
with OGR support enabled, for writing the Shapefiles. You will also need
the CGAL library (http://www.cgal.org/) installed.

Depending on your system configuration, you may need to edit the Makefile
to point to the location of the GDAL and CGAL libraries and C/C++ headers.

To build clustr, simply run 'make'. The 'clustr' executable is
self-contained (aside from shared libraries) and does not rely on any
supporting files. The code has been tested with GCC 3.4 and 4.2.

Using clustr
------------

$ clustr [-a <n>] [-p] [-v] <input> <output>

   -h, -?      this help message
   -v          be verbose (default: off)
   -a <n>      set alpha value (default: use optimal value)
   -p          output points to shapefile, instead of polygons

If <input> is missing or given as "-", stdin is used.

  * The input file should be formatted as: <tag> <lon> <lat>\n

  * The input file *must* be sorted. Piping it through sort(1) will
    suffice.

  * Tags must not contain spaces.

If <output> is missing, output is written to "clustr.shp". The output is
always an ESRI Shapefile.

The -p option simply converts the input file to a Shapefile containing the
input points. This can be useful for comparing the polygon output of clustr
to its input dataset in a GIS browser.

The -a option sets the value of "alpha", which in turn determines the
convexity of the output polygons. Larger values make more convex polygons,
smaller values make less convex polygons. Smaller values will also filter
out outlying points, which may be what you want.

Omitting -a or setting it to zero will cause clustr to use the CGAL
library's idea of "optimal alpha", which, if there are significant outliers
in the input file, may not actually be what you want. In general, we
recommend starting with a value of 0.001.

Bugs
----
At present, clustr does not handle polygon holes correctly.

- Fin -

clustr's People

Contributors

tchklovski avatar thisisaaronland avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.