de en es fr nl pl pt sv zh

algorithms

The Hausdorff Distance Challenge

Dr JTS

The Hausdorff Distance is a useful spatial function which can appear slightly mysterious. Partly this is due to the name.  It honours Felix Hausdorff, one of the founding fathers of topology, and a polymath who was creative in music and literature as well as mathematics.    Felix Hausdorff ...

Coverage Cleaning in JTS

Dr JTS

The JTS Topology Suite has been rolling out the capability to manage polygonal coverages.  It supports modelling polygonal coverages as arrays of discrete polygonal geometries.  This is simple to work with and allows using all of the wide variety of JTS algorithms.  Coverage topology allows...

Fast Coverage Union in JTS

Dr JTS

The next operation delivered in the build-out of Simple Polygonal Coverages in the JTS Topology Suite is Coverage Union. This is simply the topological union of a set of polygons in a polygonal coverage, producing one or more polygons as the result.  (This is sometimes called "dissolve" in the...

Alpha Shapes in JTS

Dr JTS

Recently JTS gained the ability to compute Concave Hulls of point sets.  The algorithm used is based the Chi-shapes approach described by Duckham et al.   It works by eroding border triangles from the Delaunay Triangulation of the input points, in order of longest triangle edge length, down to a...

Concave Hulls of Polygons

Dr JTS

A common spatial need is to compute a polygon which contains another set of polygons.  There are numerous use cases for this; for example:Generalizing groups of building outlines (questions: 1, 2) Creating "district" polygons around block polygons (questions: 1)Removing gaps between sets of...

BIO 2021 question 1

teymour

Note: you can find the question paper on the BIO website Part A This problem can be solved using a recursive algorithm: function is_pat(string: String) -> bool if string.len() == 1 then return True else is_pat = False for i=0 to string.len() - 2 do...

Cubic Bezier Curves in JTS

Dr JTS

As the title of this blog indicates, I'm a fan of linearity.  But sometimes a little non-linearity makes things more interesting.  A convenient way to generate non-linear curved lines is to use Bezier Curves.  Bezier Curves are curves defined by polynomials.  Bezier curves can be defined for...

Concave Hulls in JTS

Dr JTS

A common spatial need is to find a polygon that accurately represents a set of points.  The convex hull of the points often does not provide this, since it can enclose large areas which contain no points.  What is required is a non-convex hull, often termed the concave hull.  The Convex Hull and a...

JTS Offset Curves

Dr JTS

Offset curves (also known as parallel curves) are an oft-requested feature in JTS.  They are a natural extension to the concept of buffering, and are useful for things like placing labels along rivers.  As far as I know there is no hard-and-fast definition for how an offset curve should be...

JTS Polygon Triangulation, at last

Dr JTS

A (long) while ago I posted about "soon-to-be-released" JTS code for polygon triangulation using Ear Clipping.  It turned out it was actually in the category of "never-to-be-released".  However, later  I worked with a student, Dan Tong, on a coding exercise sponsored by Facebook. We decided to...

JTS IsSimple gets simpler (and faster)

Dr JTS

Hard to believe that the JTS Topology Suite is almost 20 years old.  That's 140 in dog years!  Despite what they say about old dogs, one of the benefits of longevity is that you have the opportunity to learn a trick or two along the way.  One of the key lessons learned after the initial release of...

Matrix Sketching

Jeffrey Wang

Last time, I wrote about a clever algorithm for approximating the histogram for a stream using bounded memory. The post was motivated by this paper, which is an extension of that algorithm to a problem that seems unrelated at first glance, which is matrix sketching. The matrix sketching problem is...

Streaming Frequency Approximation

Jeffrey Wang

It's been a while, but I finally motivated myself to write another blog post! Today's topic is approximating the frequency of items in a stream. With all the data that is generated today, streaming algorithms have become very popular as one of the efficient ways to process datasets that are far...