Repository navigation
Expand file tree
/
Copy pathdata_structure.pde
More file actions
92 lines (84 loc) · 1.85 KB
/
Copy pathdata_structure.pde
File metadata and controls
92 lines (84 loc) · 1.85 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
static final int STANZAS = 3, COORDS = 3;
final LabelCoord[][] stanzas = new LabelCoord[STANZAS][];
//these are the data structures:
{ // dummy stanza one:
stanzas[0] = new LabelCoord[] {
new LabelCoord("this is the first", -122.434216, 37.734181),
new LabelCoord("this is the second", -122.480198, 37.750747),
new LabelCoord("this is the third", -122.418789, 37.738618)
};
}
{ // dummy stanza two:
stanzas[1] = new LabelCoord[] {
new LabelCoord("1 this is 1 OK", -122.444216, 37.734181),
new LabelCoord("2 this is 2 OK", -122.490198, 37.750747)
};
}
{ // dummy stanza three:
stanzas[2] = new LabelCoord[] {
new LabelCoord("one one one one one", -122.424216, 37.734181),
new LabelCoord("two two two two two", -122.470198, 37.750747),
new LabelCoord("three three three three", -122.408789, 37.738618),
new LabelCoord("last last last lat", -122.408789, 37.738618)
};
}
//this is the object you reference in your data structure
static final class LabelCoord {
final String label;
final Point2D.Float coord;
LabelCoord(final String txt, final float lat, final float lon) {
label = txt;
coord = new Point2D.Float(lat, lon);
}
@ Override String toString() {
return label + ": " + coord;
}
}
//dummy stanza one
String[] p1 = {
"this is the first",
"this is the second",
"this it the third"
};
float[] p1lat = {
-122.434216,
-122.480198,
-122.418789
};
float[] p1lon = {
37.734181,
37.750747,
37.738618
};
//dummy stanza two
String[] p2 = {
"1",
"2",
"3"
};
float[] p2lat = {
-122.444216,
-122.490198,
-122.428789
};
float[] p2lon = {
37.734181,
37.750747,
37.738618
};
//dummy stanza three
String[] p3 = {
"one",
"two",
"three"
};
float[] p3lat = {
-122.424216,
-122.470198,
-122.408789
};
float[] p3lon = {
37.734181,
37.750747,
37.738618
};