1555{
1557 switch (geom->type)
1558 {
1559
1562 return geometry_modified;
1564 {
1567 uint32_t npoints = pa->
npoints;
1569 geometry_modified = npoints != pa->
npoints;
1570
1572 {
1573
1576 }
1577 break;
1578 }
1580 {
1581 uint32_t i, j = 0;
1583 for (i = 0; i < g->
nrings; i++)
1584 {
1586 int minpoints = 4;
1587 uint32_t npoints = 0;
1588
1589 if(!pa)
1590 continue;
1593 geometry_modified |= npoints != pa->
npoints;
1594
1596 {
1599 continue;
1600 }
1602 }
1603
1605 break;
1606 }
1608 {
1609 static uint32_t out_stack_size = 32;
1610 double tolsq = tolerance*tolerance;
1611 uint32_t i, j, n = 0;
1614 LWPOINT *out_stack[out_stack_size];
1615 int use_heap = (mpt->
ngeoms > out_stack_size);
1616
1617
1619 return geometry_modified;
1620
1621
1622
1623
1624 if (use_heap)
1626 else
1627 out = out_stack;
1628
1629
1630 for (i = 0; i < mpt->
ngeoms; i++)
1631 {
1632 int seen = 0;
1635 for (j = 0; j < n; j++)
1636 {
1640 {
1641 seen = 1;
1642 break;
1643 }
1644 }
1645 if (seen)
1646 {
1648 continue;
1649 }
1650 out[n++] = p1;
1651 }
1652
1653
1654
1656 geometry_modified = mpt->
ngeoms != n;
1658 if (use_heap)
lwfree(out);
1659 break;
1660 }
1661
1663
1664 return geometry_modified;
1665
1666
1671
1672
1677 {
1678 uint32_t i, j = 0;
1680 for (i = 0; i < col->
ngeoms; i++)
1681 {
1683 if (!g) continue;
1685
1687 {
1689 continue;
1690 }
1691 col->
geoms[j++] = g;
1692 }
1693
1695 break;
1696 }
1697 default:
1698 {
1700 break;
1701 }
1702 }
1703
1704 if (geometry_modified)
1705 {
1707 }
1708 return geometry_modified;
1709}
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 * lwalloc(size_t size)
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)
void ptarray_copy_point(POINTARRAY *pa, uint32_t from, uint32_t to)
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.
void lwgeom_free(LWGEOM *lwgeom)
void lwerror(const char *fmt,...)
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.