-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJD's zone detector script
77 lines (65 loc) · 4.14 KB
/
JD's zone detector script
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
//TODO Add the following to the build.gradle app file: compile 'com.google.maps.android:android-maps-utils:0.5+'
//desertZone List DESERT OASIS
List<LatLng> listDZ = new ArrayList<LatLng>();
listDZ.add(new LatLng(023.841609, -112.429276));
listDZ.add(new LatLng(24.122670, -90.412675));
listDZ.add(new LatLng(40.710606, -96.872636));
listDZ.add(new LatLng(40.910173, -104.431230));
listDZ.add(new LatLng(35.956646, -106.760331));
listDZ.add(new LatLng(37.226810, -113.879472));
listDZ.add(new LatLng(41.931689, -114.011307));
listDZ.add(new LatLng(41.866270, -120.295487));
listDZ.add(new LatLng(34.665725, -115.065995));
listDZ.add(new LatLng(39.058418, -125.041581));
listDZ.add(new LatLng(023.841609, -112.429276));
//snowZone List SNOWY ROUTES
List<LatLng> listSZ = new ArrayList<LatLng>();
listSZ.add(new LatLng(42.509345, -125.777665));
listSZ.add(new LatLng(45.541737, -96.993486));
listSZ.add(new LatLng(38.570483, -86.666337));
listSZ.add(new LatLng(43.537382, -54.322588));
listSZ.add(new LatLng(78.257197, -20.660478));
listSZ.add(new LatLng(61.599070, -98.092118));
listSZ.add(new LatLng(77.633243, 142.200851));
listSZ.add(new LatLng(42.509345, -125.777665));
//mountainZoneA List MOUNTAIN PASSES
List<LatLng> listMZA = new ArrayList<LatLng>();
listMZA.add(new LatLng(33.930943, -83.677411));
listMZA.add(new LatLng(40.335136, -76.799970));
listMZA.add(new LatLng(40.351883, -79.766279));
listMZA.add(new LatLng(35.197492, -86.270185));
listMZA.add(new LatLng(33.930943, -83.677411));
//mountainZoneR List
List<LatLng> listMZR = new ArrayList<LatLng>();
listMZR.add(new LatLng(37.150577, -112.055097));
listMZR.add(new LatLng(49.962795, -120.393720));
listMZR.add(new LatLng(49.962795, -111.165204));
listMZR.add(new LatLng(37.150577, -112.055097));
boolean contained = false;
LatLng tempLatLng = new LatLng(36.831945, -81.485108);
//TODO if speed>30, set location to highway, SCENIC HIGHWAYS
if (PolyUtil.containsLocation(tempLatLng, listMZR, contained)){
Toast.makeText(justmapping.this, "in Rockies", Toast.LENGTH_LONG).show();
//"tag" adventure with #2 (.9 chance)
}
else if(PolyUtil.containsLocation(tempLatLng, listMZA, contained)){
Toast.makeText(justmapping.this, "in Apps", Toast.LENGTH_LONG).show();
//"tag" adventure with #2 (.9 chance)
}
else if(PolyUtil.containsLocation(tempLatLng, listSZ, contained)) {
Toast.makeText(justmapping.this, "snowy", Toast.LENGTH_LONG).show();
//"tag" adventure with #3 (.75 chance)
}
else if(PolyUtil.containsLocation(tempLatLng, listDZ, contained)) {
Toast.makeText(justmapping.this, "Desert", Toast.LENGTH_LONG).show();
//"tag" adventure with #4 (.8 chance)
}
else{
Toast.makeText(justmapping.this, "None!", Toast.LENGTH_LONG).show();
//"tag" adventure with #5 (.8 chance), #2 (.1 chance), #3 (.1 chance)
//FORESTED TRAILS
}
//TODO feed data in from the database, and add a variable (1-5) to indicate its type
//TODO incorporate this into the icons and color of the Polylines
//TODO add speed check for highway
//TODO (if have time) add some random chance to this as well