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:
Three rotated overlapping large triangles (one colour for the triangle and a different colour for each respective edge):
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:
Triangle rotated 48 times with increasing angle (the last triangle draw has just one colour for it's edge):
Triangle rotated a bit, then the result rotated a bit - 48 times (the last triangle has just one colour for it's edge):
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):
Two rotated triangles with a two triangle intersection:
Two rotated triangles with a four triangle intersection:
Polygon with a polygon internal hole. The external edge of the polygon is coloured red and the edge of the hole is coloured blue:
GSHHS land polygons
The data obtained have five resolutions:
- full resolution: Original (full) data resolution.
- high resolution: Full with ~80% reduction in size.
- intermediate resolution: High with ~80% reduction in size.
- low resolution: Intermediate with ~80% reduction in size.
- crude resolution: Low with ~80% reduction in size.
Heirarchy ignored revealing the convex hulls with darker shade for edges:
Without some of antarctica revealing holes:
165 x 400:
660 x 1600:
825 x 2000:
45 x 42:
90 x 84:
150 x 140:
150 x 140:
160 x 212
160 x 212
- 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.
- 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:
- Global Self-Consistent Hierarchical High-Resolution Shoreline (GSHHS) data
- Surface elevation
- Land cover
- Temperature
- Rainfall
- National boundaries and human population
- Release on Maven Central.
- Investigate ways to speed up rendering.
- 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 :)
- APACHE LICENSE, VERSION 2.0
- Other licences are possible!
- 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.

















