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.
824{
827 uint32_t i;
828
829
830 if (to < from)
831 {
832 double t = from;
833 from = to;
834 to = t;
835 }
836
837 if (!lwin)
838 lwerror(
"lwgeom_clip_to_ordinate_range: null input geometry!");
839
841 {
844 break;
847 break;
850 break;
853 break;
856 break;
863 break;
864 default:
866 return NULL;
867 }
868
869
870 if (!out_col)
871 lwerror(
"lwgeom_clip_to_ordinate_range clipping routine returned NULL");
872
873
875 return out_col;
876
877
878
880
881
882 for (i = 0; i < out_col->
ngeoms; i++)
883 {
886 {
887 lwnotice(
"lwgeom_clip_to_ordinate_range cannot offset a clipped point");
888 continue;
889 }
891 {
892
894 if (!lwoff)
895 {
896 lwerror(
"lwgeom_offsetcurve returned null");
897 }
899 }
900 else
901 {
902 lwerror(
"lwgeom_clip_to_ordinate_range found an unexpected type (%s) in the offset routine",
904 }
905 }
906
907 return out_offset;
908}
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 lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error 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.