Output is to something very similar to WKT (results might be a bit
different for corner cases like empty linestrings etc.) This is only to
be used for debugging. When tests fail the Catch framework will now
output the geometries properly.
This adds a dimension() function for all geometry types. The topological
dimension is defined as 0 for point geometries, 1 for linear geometries
and 2 for areal geometries. For geometry collections it is the largest
dimension of any of its members.
See https://postgis.net/docs/manual-3.3/ST_Dimension.html
It is needed for the implementation of centroid() for geometry
collections.
The template we used before interfered with the normal operation of the
class because it matched geometry_t itself, so it worked as copy
constructor. With the explicit functions we remove that problem and make
sure the different types can only be moved into the geometry_t object,
so we don't copy unnecessarily without noticing.
The simplification function can generate a linestring with a single
point in it, which wouldn't be a line any more. Return a null geometry
in that case.