Skip to content

agdturner/ccg-r2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Visualising geometry helps develop ccg-v2d. The work in 2D is helping develop 3D geometry libraries: ccg-v3d and ccg-r3d. Some example static renderings of data are shown below.

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 geography data come in five resolutions:

  1. full resolution: Original (full) data resolution.
  2. high resolution: About 80 % reduction in size and quality.
  3. intermediate resolution: Another ~80 % reduction.
  4. low resolution: Another ~80 % reduction.
  5. crude resolution: Another ~80 % reduction.

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
  • Mainly ccg-v2d for vectors and ccg-grids for rasters. Both of thesehave few light weight dependencies.
  • 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:
  • Make a versioned release on Maven Central.
  • Investigate ways to speed up rendering.
  • Community development:
    • Raise awareness
    • Develop use cases
    • Reach out to developers of (GMT, Apache SIS, JTS).

Contributing

  • Thanks for thinking about this.
  • For a collaborative project, there should be a Code of Conduct and Contributor Guide based on something like this: Open Source Guide
  • Meanwhile if you want instructions or 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.