1780{
1782 uint64_t numedges, i, j;
1784
1785
1786 numedges = 0;
1788 for (i=0; i<num_signed_edge_ids; ++i) {
1789 int absid = llabs(signed_edge_ids[i]);
1790 int found = 0;
1791
1792 for (j=0; j<numedges; ++j) {
1793 if ( edge_ids[j] == absid ) {
1794 found = 1;
1795 break;
1796 }
1797 }
1798 if ( ! found ) edge_ids[numedges++] = absid;
1799 }
1800 i = numedges;
1804 if (i == UINT64_MAX)
1805 {
1807 return NULL;
1808 }
1809 else if ( i != numedges )
1810 {
1811 lwfree( signed_edge_ids );
1814 " edges found when expecting %" PRIu64, i, numedges);
1815 return NULL;
1816 }
1817
1818
1819
1820
1822 for ( i=0; i<num_signed_edge_ids; ++i )
1823 {
1828 for ( j=0; j<numedges; ++j )
1829 {
1830 if ( ring_edges[j].edge_id == llabs(eid) )
1831 {
1832 edge = &(ring_edges[j]);
1833 break;
1834 }
1835 }
1836 if ( edge == NULL )
1837 {
1839 lwerror(
"missing edge that was found in ring edges loop");
1840 return NULL;
1841 }
1842
1843 if ( pa == NULL )
1844 {
1847 }
1848 else
1849 {
1850 if ( eid < 0 )
1851 {
1856 }
1857 else
1858 {
1859
1861 }
1862 }
1863 }
1866 points[0] = pa;
1867
1868
1869
1870
1872 return shell;
1873}
int ptarray_append_ptarray(POINTARRAY *pa1, POINTARRAY *pa2, double gap_tolerance)
Append a POINTARRAY, pa2 to the end of an existing POINTARRAY, pa1.
void * lwalloc(size_t size)
void ptarray_free(POINTARRAY *pa)
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
POINTARRAY * ptarray_clone_deep(const POINTARRAY *ptarray)
Deep clone a pointarray (also clones serialized pointlist)
void ptarray_reverse_in_place(POINTARRAY *pa)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWT_COL_EDGE_EDGE_ID
Edge fields.
#define LWT_COL_EDGE_GEOM
#define PGTOPO_BE_ERROR()
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
LWT_ISO_EDGE * lwt_be_getEdgeById(LWT_TOPOLOGY *topo, const LWT_ELEMID *ids, uint64_t *numelems, int fields)
void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)