Definition at line 1695 of file lwgeom.c.
1696{
1699 {
1700
1703 return geometry_modified;
1707 uint32_t npoints = pa->
npoints;
1709 geometry_modified = npoints != pa->
npoints;
1710
1712 {
1715 }
1716 break;
1717 }
1719 uint32_t j = 0;
1721 for (uint32_t i = 0; i < g->
nrings; i++)
1722 {
1724 uint32_t npoints = pa->
npoints;
1726 geometry_modified |= npoints != pa->
npoints;
1727
1729 {
1732 continue;
1733 }
1735 }
1736
1738 break;
1739 }
1741 double tolsq = tolerance * tolerance;
1743
1744 for (uint8_t dim = 0; dim < 2; dim++)
1745 {
1746
1748 for (uint32_t i = 0; i < mpt->
ngeoms; i++)
1749 {
1751 continue;
1752
1754 if (!pti) continue;
1755
1756
1757 for (uint32_t j = i + 1; j < mpt->
ngeoms; j++)
1758 {
1760 continue;
1761
1763 if (!ptj) continue;
1764
1765
1766 if ((dim ? ptj->
x - pti->
x : ptj->
y - pti->
y) > tolerance)
1767 break;
1768
1769
1771 {
1773 mpt->
geoms[j] = NULL;
1775 }
1776 }
1777 }
1778
1779
1780 for (uint32_t j = 0; j < mpt->
ngeoms; j++)
1781 {
1783 {
1785 mpt->
geoms[j] = NULL;
1787 }
1788 }
1789
1790
1791 uint32_t i = 0;
1792 for (uint32_t j = 0; j < mpt->
ngeoms; j++)
1796 }
1797
1798 break;
1799 }
1800
1802
1803 return geometry_modified;
1804
1805
1810
1811
1816 uint32_t i, j = 0;
1818 for (i = 0; i < col->
ngeoms; i++)
1819 {
1821 if (!g)
1822 continue;
1824
1826 {
1828 continue;
1829 }
1830 col->
geoms[j++] = g;
1831 }
1832
1834 break;
1835 }
1836 default: {
1838 break;
1839 }
1840 }
1841
1842 if (geometry_modified)
1844 return geometry_modified;
1845}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwpoint_free(LWPOINT *pt)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
void ptarray_free(POINTARRAY *pa)
#define LW_TRUE
Return types for functions with status returns.
void ptarray_remove_repeated_points_in_place(POINTARRAY *pa, double tolerance, uint32_t min_points)
int lwpoint_is_empty(const LWPOINT *point)
static int cmp_point_x(const void *pa, const void *pb)
int lwgeom_remove_repeated_points_in_place(LWGEOM *geom, double tolerance)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
static int cmp_point_y(const void *pa, const void *pb)
void lwgeom_free(LWGEOM *lwgeom)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static double distance2d_sqr_pt_pt(const POINT2D *p1, const POINT2D *p2)
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 const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
References CIRCSTRINGTYPE, cmp_point_x(), cmp_point_y(), COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, distance2d_sqr_pt_pt(), LWMPOINT::geoms, LWCOLLECTION::geoms, getPoint2d_cp(), LINETYPE, LW_FALSE, LW_TRUE, lwerror(), lwgeom_drop_bbox(), lwgeom_free(), lwgeom_is_empty(), lwgeom_remove_repeated_points_in_place(), lwpoint_free(), lwpoint_is_empty(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, LWMPOINT::ngeoms, LWCOLLECTION::ngeoms, POINTARRAY::npoints, LWPOLY::nrings, LWPOINT::point, LWLINE::points, POINTTYPE, POLYGONTYPE, ptarray_free(), ptarray_remove_repeated_points_in_place(), LWPOLY::rings, TINTYPE, TRIANGLETYPE, LWGEOM::type, POINT2D::x, and POINT2D::y.
Referenced by lwgeom_remove_repeated_points(), lwgeom_remove_repeated_points_in_place(), mvt_geom(), ST_RemoveRepeatedPoints(), and test_lwgeom_remove_repeated_points().