Wiki

Clone wiki

SwingSimplify / Home

Original requirement

I'm looking for a Java algorithms specialist to develop a Java method that is able to perform a "simplify" operation on a series of time-stamped data:

public int[] simplify(long[] time, double []dLat, double []dLong, double[] course);

A simplify algorithm is one that when given a curve composed of line segments, it seeks a similar curve with fewer points. The points returned by the algorithm produced here should be a subset of the data points passed in.

A web-page containing sample simplify algorithms is at: http:softsurfer.com/Archive/algorithm_0205/algorithm_0205.htm

One of these is described in further detail at: http:en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm

The attached datafile contains data in the following format

  1. date (yymmdd)
  2. time (hhmmss)
  3. lat degs
  4. lat mins
  5. lat secs
  6. lat hemi
  7. long degs
  8. long mins
  9. long secs
  10. long hemi
  11. course

The simplify algorithm will take a parameter that indicates how many points should be in the resulting polyline. The algorithm will return an array of the specified length containing the most signfiicant points to retain to keep the general shape of the polyline.

The algorithm should be created within a test-harness. The test-harness UI (probably in Swing) will load the provided data and show a linked x-y scatter plot (probably generated via JFreeChart). A slider in the UI will allow the user to select the number of output points, from 1 to the number of points in the sample data. Adjusting the slider will repeatedly call the simplify algorithm - with a second "simplifed" polyline drawn on the scatter plot - to show what the line looks like when represented by varying amounts of output points.

Updated