-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgeos_perf_test_delaunay.c
60 lines (47 loc) · 1.22 KB
/
geos_perf_test_delaunay.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
54
55
56
57
58
59
#include <stdio.h>
#include <float.h>
#include "geos_perf.h"
/*************************************************************************
* PERFORMANCE TEST
*/
static GEOSGeometry* mpoint = NULL;
//SELECT ST_AsText(ST_Collect(ST_Point(1000*Random(), 1000*Random())),5)
//FROM Generate_series(1,1000);
/* Read any data we need, and create any structures */
static void
setup(void)
{
mpoint = read_geometry_file("multipoint_random_1000.wkt.gz");
}
/* Build a triangulation of the input multipoint */
static void
run(void)
{
GEOSGeometry *delaunay = NULL;
if (mpoint)
delaunay = GEOSDelaunayTriangulation(mpoint, 0.0, 1);
if (delaunay)
GEOSGeom_destroy(delaunay);
}
/* Clean up any remaining memory */
static void
cleanup(void)
{
if (mpoint) GEOSGeom_destroy(mpoint);
}
/*************************************************************************
* CONFIGURATION CALLBACK FUNCTION
*/
gp_test config_delaunay(void)
{
gp_test test;
test.name = "Delaunay";
test.description =
"Load a multipoint, and build a delaunay triangulation"
"of the points.";
test.func_setup = setup;
test.func_run = run;
test.func_cleanup = cleanup;
test.count = 2000;
return test;
}