Commit Graph

11 Commits

Author SHA1 Message Date
7ba523ba37 Update copyright date to 2023 2023-01-15 16:13:42 +01:00
4fc662d610 Implement simplify for multilinestrings
Use new remove_duplicates() functions to make sure boost::geometry
simplify doesn't create something we don't like.
2022-09-30 10:12:22 +02:00
4180885504 Add stream output functions for geometry types for debugging
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.
2022-09-28 17:19:06 +02:00
0e76254e76 Add dimension() function for geometry types
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.
2022-09-26 10:16:12 +02:00
047f3e0d17 length for flex output 2022-09-24 15:46:26 +00:00
8b55943c1c Add reverse() function to reverse linestring (and other) geometries 2022-09-12 17:00:38 +02:00
dd788226d5 Add geometry_n() function to get the nth geometry of a multi geometry 2022-08-06 17:19:02 +02:00
a9bbbb8f90 Use extra functions for each type to be moved into geometry_t
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.
2022-08-01 10:55:49 +02:00
de145c2018 Ensure that the result of geom::simplify() is a valid geom or null
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.
2022-07-31 11:43:47 +02:00
c735ff04d2 Add geom::simplify() function
For linestrings only. For polygons we'll need something else.
2022-07-30 10:49:44 +02:00
b6038906a5 Split up test-geom-lines.cpp
Into files with tests for linestrings and multilinestrings, respectively.
2022-07-28 20:53:21 +02:00