6779{
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6799 int numfaces = -1;
6802 int i;
6803 int err = 0;
6804
6807
6809
6810
6811
6812
6813
6815 if ( numfaces != 0 ) {
6816 if ( numfaces > 0 ) {
6817
6818 lwerror(
"Polygonize: face table is not empty.");
6819 }
6820
6821 return -1;
6822 }
6823
6824
6826 if ( ! edgetable.
edges ) {
6827 if (edgetable.
size == 0) {
6828
6829 return 0;
6830 }
6831
6832 return -1;
6833 }
6834
6835
6837
6838
6839 for (i=0; i<edgetable.
size; ++i)
6841
6842 i = 0;
6843 while (1)
6844 {
6846 if ( i < 0 ) break;
6847 edge = &(edgetable.
edges[i]);
6848
6850
6851 LWDEBUGF(1,
"Next face-missing edge has id:%d, face_left:%d, face_right:%d",
6854 {
6856 &holes, &shells, &newface);
6857 if ( err ) break;
6858 LWDEBUGF(1,
"New face on the left of edge %d is %d",
6861 }
6863 {
6865 &holes, &shells, &newface);
6866 if ( err ) break;
6867 LWDEBUGF(1,
"New face on the right of edge %d is %d",
6870 }
6871 }
6872
6873 if ( err )
6874 {
6878 lwerror(
"Errors fetching or registering face-missing edges: %s",
6880 return -1;
6881 }
6882
6884
6885
6886
6887
6888 for (i=0; i<holes.
size; ++i)
6889 {
6892
6895 if ( containing_face == -1 )
6896 {
6900 lwerror(
"Errors finding face containing ring: %s",
6902 return -1;
6903 }
6905 if ( ret )
6906 {
6910 lwerror(
"Errors updating edgering side face: %s",
6912 return -1;
6913 }
6914 }
6915
6916 LWDEBUG(1,
"All holes assigned, cleaning up");
6917
6919
6920
6923
6924 return 0;
6925}
void lwgeom_geos_error(const char *fmt,...)
LWT_INT64 LWT_ELEMID
Identifier of topology element.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
static int _lwt_UpdateEdgeRingSideFace(LWT_TOPOLOGY *topo, LWT_EDGERING *ring, LWT_ELEMID face)
static int _lwt_CheckFacesExist(LWT_TOPOLOGY *topo)
#define LWT_EDGERING_ARRAY_INIT(a)
static int _lwt_RegisterFaceOnEdgeSide(LWT_TOPOLOGY *topo, LWT_ISO_EDGE *edge, int side, LWT_ISO_EDGE_TABLE *edges, LWT_EDGERING_ARRAY *holes, LWT_EDGERING_ARRAY *shells, LWT_ELEMID *registered)
static LWT_ISO_EDGE * _lwt_FetchAllEdges(LWT_TOPOLOGY *topo, int *numedges)
static LWT_ELEMID _lwt_FindFaceContainingRing(LWT_TOPOLOGY *topo, LWT_EDGERING *ring, LWT_EDGERING_ARRAY *shells)
#define LWT_EDGERING_ARRAY_CLEAN(a)
static int compare_iso_edges_by_id(const void *si1, const void *si2)
const char * lwt_be_lastErrorMessage(const LWT_BE_IFACE *be)
static int _lwt_FetchNextUnvisitedEdge(__attribute__((__unused__)) LWT_TOPOLOGY *topo, LWT_ISO_EDGE_TABLE *etab, int from)
static void _lwt_release_edges(LWT_ISO_EDGE *edges, int num_edges)
const LWT_BE_IFACE * be_iface