1811{
1812 uint32_t kept_it = 0;
1813 uint32_t last_it = pa->
npoints - 1;
1816
1817 for (uint32_t i = 1; i < last_it; i++)
1818 {
1821
1822 double ba_x = next_pt->
x - kept_pt->
x;
1823 double ba_y = next_pt->
y - kept_pt->
y;
1824 double ab_length_sqr = ba_x * ba_x + ba_y * ba_y;
1825
1826 double ca_x = curr_pt->
x - kept_pt->
x;
1827 double ca_y = curr_pt->
y - kept_pt->
y;
1828 double dot_ac_ab = ca_x * ba_x + ca_y * ba_y;
1829 double s_numerator = ca_x * ba_y - ca_y * ba_x;
1830
1832 dot_ac_ab < 0.0 ||
1833 dot_ac_ab > ab_length_sqr ||
1834 s_numerator != 0)
1835
1836 {
1837 kept_it++;
1838 kept_pt = curr_pt;
1839 if (kept_it != i)
1842 pt_size);
1843 }
1844 }
1845
1846
1847 kept_it++;
1848 if (kept_it != last_it)
1851 pt_size);
1853}
int p2d_same(const POINT2D *p1, const POINT2D *p2)
static size_t ptarray_point_size(const POINTARRAY *pa)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
uint8_t * serialized_pointlist