-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.odin
59 lines (49 loc) · 1.21 KB
/
structs.odin
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
package h3
// latitude/longitude in radians
LatLng :: struct {
lat: f64,
lng: f64,
}
// cell boundary in latitude/longitude
CellBoundary :: struct {
numVerts: int,
verts: [MAX_CELL_BNDRY_VERTS]LatLng,
}
// similar to CellBoundary, but requires more alloc work
GeoLoop :: struct {
numVerts: int,
verts: ^LatLng,
}
// Simplified core of GeoJSON Polygon coordinates definition
GeoPolygon :: struct {
geoLoop: GeoLoop,
numHoles: int,
holes: ^GeoLoop,
}
// Simplified core of GeoJSON MultiPolygon coordinates definition
GeoMultiPolygon :: struct {
numPolygons: int,
polygons: ^GeoPolygon,
}
// A coordinate node in a linked geo structure, part of a linked list
LinkedLatLng :: struct{
vertex: LatLng,
next: ^LinkedLatLng,
}
// A loop node in a linked geo structure, part of a linked list
LinkedGeoLoop :: struct {
first: ^LinkedLatLng,
last: ^LinkedLatLng,
next: ^LinkedGeoLoop,
}
// A polygon node in a linked geo structure, part of a linked list.
LinkedGeoPolygon :: struct{
first: ^LinkedGeoLoop,
last: ^LinkedGeoLoop,
next: ^LinkedGeoPolygon,
}
// IJ hexagon coordinates, Each axis is spaced 120 degrees apart.
CoordIJ :: struct {
i: int,
j: int,
}