Definition at line 1667 of file lwgeom.c.
1668{
1670 switch (geom->type)
1671 {
1672
1675 return geometry_modified;
1679 uint32_t npoints = pa->
npoints;
1681 geometry_modified = npoints != pa->
npoints;
1682
1684 {
1687 }
1688 break;
1689 }
1691 uint32_t j = 0;
1693 for (uint32_t i = 0; i < g->
nrings; i++)
1694 {
1696 uint32_t npoints = pa->
npoints;
1698 geometry_modified |= npoints != pa->
npoints;
1699
1701 {
1704 continue;
1705 }
1707 }
1708
1710 break;
1711 }
1713 double tolsq = tolerance * tolerance;
1715
1716 for (uint8_t dim = 0; dim < 2; dim++)
1717 {
1718
1720 for (uint32_t i = 0; i < mpt->
ngeoms; i++)
1721 {
1723 continue;
1724
1726 if (!pti) continue;
1727
1728
1729 for (uint32_t j = i + 1; j < mpt->
ngeoms; j++)
1730 {
1732 continue;
1733
1735 if (!ptj) continue;
1736
1737
1738 if ((dim ? ptj->
x - pti->
x : ptj->
y - pti->
y) > tolerance)
1739 break;
1740
1741
1743 {
1745 mpt->
geoms[j] = NULL;
1747 }
1748 }
1749 }
1750
1751
1752 for (uint32_t j = 0; j < mpt->
ngeoms; j++)
1753 {
1755 {
1757 mpt->
geoms[j] = NULL;
1759 }
1760 }
1761
1762
1763 uint32_t i = 0;
1764 for (uint32_t j = 0; j < mpt->
ngeoms; j++)
1768 }
1769
1770 break;
1771 }
1772
1774
1775 return geometry_modified;
1776
1777
1782
1783
1788 uint32_t i, j = 0;
1790 for (i = 0; i < col->
ngeoms; i++)
1791 {
1793 if (!g)
1794 continue;
1796
1798 {
1800 continue;
1801 }
1802 col->
geoms[j++] = g;
1803 }
1804
1806 break;
1807 }
1808 default: {
1810 break;
1811 }
1812 }
1813
1814 if (geometry_modified)
1816 return geometry_modified;
1817}
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().