1742{
1744 uint64_t numedges, i, j;
1746
1747
1748 numedges = 0;
1750 for (i=0; i<num_signed_edge_ids; ++i) {
1751 int absid = llabs(signed_edge_ids[i]);
1752 int found = 0;
1753
1754 for (j=0; j<numedges; ++j) {
1755 if ( edge_ids[j] == absid ) {
1756 found = 1;
1757 break;
1758 }
1759 }
1760 if ( ! found ) edge_ids[numedges++] = absid;
1761 }
1762 i = numedges;
1766 if (i == UINT64_MAX)
1767 {
1769 return NULL;
1770 }
1771 else if ( i != numedges )
1772 {
1773 lwfree( signed_edge_ids );
1775 lwerror(
"Unexpected error: %d edges found when expecting %d", i, numedges);
1776 return NULL;
1777 }
1778
1779
1780
1781
1783 for ( i=0; i<num_signed_edge_ids; ++i )
1784 {
1789 for ( j=0; j<numedges; ++j )
1790 {
1791 if ( ring_edges[j].edge_id == llabs(eid) )
1792 {
1793 edge = &(ring_edges[j]);
1794 break;
1795 }
1796 }
1797 if ( edge == NULL )
1798 {
1800 lwerror(
"missing edge that was found in ring edges loop");
1801 return NULL;
1802 }
1803
1804 if ( pa == NULL )
1805 {
1808 }
1809 else
1810 {
1811 if ( eid < 0 )
1812 {
1817 }
1818 else
1819 {
1820
1822 }
1823 }
1824 }
1827 points[0] = pa;
1828
1829
1830
1831
1833 return shell;
1834}
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 LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
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)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
const LWT_BE_IFACE * be_iface