Given a geometry clip based on the from/to range of one of its ordinates (x, y, z, m).
Use for m- and z- clipping.
830{
833 uint32_t i;
834
835
836 if (to < from)
837 {
838 double t = from;
839 from = to;
840 to = t;
841 }
842
843 if (!lwin)
844 lwerror(
"lwgeom_clip_to_ordinate_range: null input geometry!");
845
847 {
850 break;
853 break;
856 break;
859 break;
862 break;
869 break;
870 default:
872 return NULL;
873 }
874
875
876 if (!out_col)
877 lwerror(
"lwgeom_clip_to_ordinate_range clipping routine returned NULL");
878
879
881 return out_col;
882
883
884
886
887
888 for (i = 0; i < out_col->
ngeoms; i++)
889 {
892 {
893 lwnotice(
"lwgeom_clip_to_ordinate_range cannot offset a clipped point");
894 continue;
895 }
897 {
898
900 if (!lwoff)
901 {
902 lwerror(
"lwgeom_offsetcurve returned null");
903 }
905 }
906 else
907 {
908 lwerror(
"lwgeom_clip_to_ordinate_range found an unexpected type (%s) in the offset routine",
910 }
911 }
912
913 return out_offset;
914}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define POLYHEDRALSURFACETYPE
LWGEOM * lwgeom_offsetcurve(const LWGEOM *geom, double size, int quadsegs, int joinStyle, double mitreLimit)
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static LWCOLLECTION * lwcollection_clip_to_ordinate_range(const LWCOLLECTION *icol, char ordinate, double from, double to)
Clip an input COLLECTION between two values, on any ordinate input.
static LWCOLLECTION * lwpoint_clip_to_ordinate_range(const LWPOINT *point, char ordinate, double from, double to)
Clip an input POINT between two values, on any ordinate input.
static LWCOLLECTION * lwline_clip_to_ordinate_range(const LWLINE *line, char ordinate, double from, double to)
Take in a LINESTRING and return a MULTILINESTRING of those portions of the LINESTRING between the fro...
static LWCOLLECTION * lwtriangle_clip_to_ordinate_range(const LWTRIANGLE *tri, char ordinate, double from, double to)
Clip an input LWTRIANGLE between two values, on any ordinate input.
static LWCOLLECTION * lwpoly_clip_to_ordinate_range(const LWPOLY *poly, char ordinate, double from, double to)
Clip an input LWPOLY between two values, on any ordinate input.
static LWCOLLECTION * lwmpoint_clip_to_ordinate_range(const LWMPOINT *mpoint, char ordinate, double from, double to)
Clip an input MULTIPOINT between two values, on any ordinate input.