1897{
1899 uint64_t numedges, i, j;
1901
1902
1903 numedges = 0;
1905 for (i=0; i<num_signed_edge_ids; ++i) {
1906 int absid = llabs(signed_edge_ids[i]);
1907 int found = 0;
1908
1909 for (j=0; j<numedges; ++j) {
1910 if ( edge_ids[j] == absid ) {
1911 found = 1;
1912 break;
1913 }
1914 }
1915 if ( ! found ) edge_ids[numedges++] = absid;
1916 }
1917 i = numedges;
1921 if (i == UINT64_MAX)
1922 {
1924 return NULL;
1925 }
1926 else if ( i != numedges )
1927 {
1928 lwfree( signed_edge_ids );
1931 " edges found when expecting %" PRIu64, i, numedges);
1932 return NULL;
1933 }
1934
1935
1936
1937
1939 for ( i=0; i<num_signed_edge_ids; ++i )
1940 {
1945 for ( j=0; j<numedges; ++j )
1946 {
1947 if ( ring_edges[j].edge_id == llabs(eid) )
1948 {
1949 edge = &(ring_edges[j]);
1950 break;
1951 }
1952 }
1953 if ( edge == NULL )
1954 {
1956 lwerror(
"missing edge that was found in ring edges loop");
1957 return NULL;
1958 }
1959
1960 if ( pa == NULL )
1961 {
1964 }
1965 else
1966 {
1967 if ( eid < 0 )
1968 {
1973 }
1974 else
1975 {
1976
1978 }
1979 }
1980 }
1983 points[0] = pa;
1984
1985
1986
1987
1989 return shell;
1990}
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)