PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_geos_makevalid()

static void test_geos_makevalid ( void  )
static

Definition at line 127 of file cu_geos.c.

128 {
129  uint8_t* wkb;
130  char* out_ewkt;
131  LWGEOM* geom1;
132  LWGEOM* geom2;
133  LWGEOM* geom3;
134 
135  wkb = (uint8_t*) "\001\003\000\000\000\001\000\000\000\011\000\000\000b\020X9 }\366@7\211A\340\235I\034A\316\326t18}\366@\306g\347\323\230I\034Ay\351&18}\366@\331\316\367\323\230I\034A\372~j\274\370}\366@\315\314\314LpI\034A\343\245\233\304R}\366@R\270\036\005?I\034A\315\314\314\314Z~\366@\343\245\233\304\007I\034A\004V\016-\242}\366@\252\361\322M\323H\034A\351&1\010\306{\366@H\341z\0247I\034Ab\020X9 }\366@7\211A\340\235I\034A";
136  geom1 = lwgeom_from_wkb(wkb, 157, LW_PARSER_CHECK_NONE);
137  geom2 = lwgeom_make_valid(geom1);
138  geom3 = lwgeom_normalize(geom2); //so GEOS 3.9 and 3.10 agree
139  out_ewkt = lwgeom_to_ewkt((LWGEOM*)geom3);
140 
141  #if POSTGIS_GEOS_VERSION < 39
143  out_ewkt,
144  "GEOMETRYCOLLECTION(POLYGON((92092.377 463437.77,92114.014 463463.469,92115.5120743 463462.206937,92115.512 463462.207,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77)),MULTIPOINT(92122.136 463412.826,92115.5120743 463462.206937))");
145 #else
147  out_ewkt,
148  "POLYGON((92092.377 463437.77,92114.014 463463.469,92115.512 463462.207,92115.5120743 463462.206937,92127.546 463452.075,92117.173 463439.755,92133.675 463425.942,92122.136 463412.826,92092.377 463437.77))");
149 #endif
150  lwfree(out_ewkt);
151  lwgeom_free(geom1);
152  lwgeom_free(geom2);
153  lwgeom_free(geom3);
154 }
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2005
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:556
void lwfree(void *mem)
Definition: lwutil.c:244
LWGEOM * lwgeom_normalize(const LWGEOM *geom)
LWGEOM * lwgeom_from_wkb(const uint8_t *wkb, const size_t wkb_size, const char check)
WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory...
Definition: lwin_wkb.c:789
LWGEOM * lwgeom_make_valid(LWGEOM *geom)
Attempts to make an invalid geometries valid w/out losing points.
unsigned char uint8_t
Definition: uthash.h:79

References ASSERT_STRING_EQUAL, LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), lwgeom_from_wkb(), lwgeom_make_valid(), lwgeom_normalize(), and lwgeom_to_ewkt().

Referenced by geos_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: