Skip to content

agdturner/ccg-r2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

114 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Java library for rendering 2D Euclidean spatial data using ccg-v2d for vector (point, line, polygon) data and ccg-grids for raster data. Being able to visualise things like intersections is useful in debugging the geometry algorithms. The work in 2D is also informs work in 3D: ccg-v3d and ccg-r3d.

Other similar and perhaps more useful developments include GMT, Apache SIS and JTS.

Below are some example static renderings of data produced with this library:

GSHHS low resolution land/sea polygons, 825 x 2000:

GSHHS c Global 825 x 2000

Triangle rotations, colours and circumcircles

Three rotated overlapping large triangles (one colour for the triangle and a different colour for each respective edge):

Three rotated overlapping large triangles

Multiple small rotated triangles some overlapping with their circumcircle outlines drawn in white (one colour for all triangles and a different colour for each respective edge:

Multiple small rotated triangles some overlapping with their circumcircle outlines drawn in white

Triangle rotated 48 times with increasing angle (the last triangle draw has just one colour for it's edge):

Triangle rotated 48 times with increasing angle

Triangle rotated a bit, then the result rotated a bit - 48 times (the last triangle has just one colour for it's edge):

Triangle rotated a bit, then the result rotated a bit - 48 times

With grids

A triangle on a couple of randomly coloured grids (one grid underlies the other, the top grid is located in the upper right of the image):

A triangle on a couple of randomly coloured grids

Triangle intersections

Two rotated triangles with a two triangle intersection:

A first rendering of a triangle on a couple of randomly coloured grids

Two rotated triangles with a four triangle intersection:

Two rotated triangles with a four triangle intersection

Polygon

Polygon with a polygon internal hole. The external edge of the polygon is coloured red and the edge of the hole is coloured blue:

Polygon that is not a convex hull with a darker outline and with a polygonal hole with the external edge coloured red and the internal edge coloured blue

GSHHS land polygons

The data obtained have five resolutions:

  1. full resolution: Original (full) data resolution.
  2. high resolution: Full with ~80% reduction in size.
  3. intermediate resolution: High with ~80% reduction in size.
  4. low resolution: Intermediate with ~80% reduction in size.
  5. crude resolution: Low with ~80% reduction in size.

Global

Crude resolution

Heirarchy ignored revealing the convex hulls with darker shade for edges:

GSHHS c global with convex hull darker gray edges

Without some of antarctica revealing holes:

165 x 400:

GSHHS c Global 165 x 400

660 x 1600:

GSHHS c Global 660 x 1600

825 x 2000:

GSHHS c Global 825 x 2000

Great Britain

Crude resolution

45 x 42:

GSHHS c Great Britain 45 x 42

90 x 84:

GSHHS c Great Britain 90 x 84

150 x 140:

GSHHS c Great Britain 150 x 140

Low resolution

150 x 140:

GSHHS l Great Britain 150 x 140

Isle of Man

Intermediate resolution

160 x 212

GSHHS l Isle of Man 160 x 212

Full resolution

160 x 212

GSHHS l Isle of Man 80 x 106

Dependencies

  • Java SE 21
  • ccg-v2d for vector data.
  • ccg-grids for raster data.
  • Both ccg-v2d and ccg-grids have further dependencies. These are lightweight. There are additional dependencies for testing. Please see the POM for details.

Development plans/ideas

  • Calculate and show some example polygon-polygon intersections.
  • Create some animations with geometries moving relative to others.
  • Generate some more example renderings of geographical data:
  • Release on Maven Central.
  • Investigate ways to speed up rendering.

Contributing

  • Please contribute in the normal way. If you modify source code files, then please add you author details to the header of the file.
  • For a collaborative project, there should be a Code of Conduct and Contributor Guide based on something like this: Open Source Guide
  • Meanwhile if there is an issue, please report this in the usual way :)

LICENCE

Acknowledgements and thanks

  • The University of Leeds has indirectly supported this work by employing me over the years and encouraging me to develop the skills necessary to produce this library.
  • Thank you Eric for the BigMath library.

About

2D Euclidean geometry rendering

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages