-
Notifications
You must be signed in to change notification settings - Fork 1
/
geos_perf_test_isvalid1.c
54 lines (45 loc) · 1.34 KB
/
geos_perf_test_isvalid1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdio.h>
#include "geos_perf.h"
/*************************************************************************
* PERFORMANCE TEST
*/
/* Variables where data lives between the setup/run/cleanup stages */
static GEOSGeometryList australiaFile;
static GEOSGeometry *australia;
/* Read any data we need, and create any structures */
static void setup(void)
{
geomlist_init(&australiaFile);
read_data_file("australia.wkt.gz", &australiaFile);
/* takes ownership of just the first geometry */
australia = australiaFile.geoms[0];
/* gently free just the containing geomlist */
geomlist_release(&australiaFile);
}
/* For each run, union all the geometries in the collection */
static void run(void)
{
char iv = GEOSisValid(australia);
}
/* Clean up any remaining memory */
static void cleanup(void)
{
GEOSGeom_destroy(australia);
}
/*************************************************************************
* CONFIGURATION CALLBACK FUNCTION
*/
gp_test config_isvalid_australia(void)
{
gp_test test;
test.name = "Australia isValid";
test.description =
"Load a complex boundary of Australia with many"
"offshore islands and calculate valididy of"
"the multi-polygon.";
test.func_setup = setup;
test.func_run = run;
test.func_cleanup = cleanup;
test.count = 4;
return test;
}