Skip to content

Commit a80d373

Browse files
Merge branch 'dev' into feature-profileScreen
2 parents 2bd5d17 + 00dd682 commit a80d373

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1203
-442
lines changed

.DS_Store

6 KB
Binary file not shown.

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
973FC0482B5A477E00878269 /* CrossMarking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FC0472B5A477E00878269 /* CrossMarking.swift */; };
6262
973FC04A2B5A478C00878269 /* CrossMarkingForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FC0492B5A478C00878269 /* CrossMarkingForm.swift */; };
6363
973FC04C2B5A5F5F00878269 /* RadioItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FC04B2B5A5F5F00878269 /* RadioItem.swift */; };
64+
97439F782B87444200DA43E1 /* CrossingKerbHeightForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97439F772B87444200DA43E1 /* CrossingKerbHeightForm.swift */; };
65+
97439F7A2B87447400DA43E1 /* CrossingKerbHeight.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97439F792B87447400DA43E1 /* CrossingKerbHeight.swift */; };
66+
97A014BF2B7B580700F7C277 /* OSMMapData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A014BE2B7B580700F7C277 /* OSMMapData.swift */; };
67+
97A014C12B7C95A500F7C277 /* OSMElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A014C02B7C95A500F7C277 /* OSMElement.swift */; };
6468
97AC1C062B6A45B0004F0BF4 /* SideWalkValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AC1C052B6A45B0004F0BF4 /* SideWalkValidation.swift */; };
6569
97AC1C082B6A45C9004F0BF4 /* SideWalkValidationForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AC1C072B6A45C9004F0BF4 /* SideWalkValidationForm.swift */; };
6670
97AC1C0A2B6B7F10004F0BF4 /* CustomVerticalButtonsList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AC1C092B6B7F10004F0BF4 /* CustomVerticalButtonsList.swift */; };
@@ -320,6 +324,10 @@
320324
973FC0472B5A477E00878269 /* CrossMarking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CrossMarking.swift; path = GoInfoGame/quests/CrossingMarking/CrossMarking.swift; sourceTree = SOURCE_ROOT; };
321325
973FC0492B5A478C00878269 /* CrossMarkingForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = CrossMarkingForm.swift; path = GoInfoGame/quests/CrossingMarking/CrossMarkingForm.swift; sourceTree = SOURCE_ROOT; };
322326
973FC04B2B5A5F5F00878269 /* RadioItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadioItem.swift; sourceTree = "<group>"; };
327+
97439F772B87444200DA43E1 /* CrossingKerbHeightForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossingKerbHeightForm.swift; sourceTree = "<group>"; };
328+
97439F792B87447400DA43E1 /* CrossingKerbHeight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossingKerbHeight.swift; sourceTree = "<group>"; };
329+
97A014BE2B7B580700F7C277 /* OSMMapData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSMMapData.swift; sourceTree = "<group>"; };
330+
97A014C02B7C95A500F7C277 /* OSMElement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSMElement.swift; sourceTree = "<group>"; };
323331
97AC1C052B6A45B0004F0BF4 /* SideWalkValidation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideWalkValidation.swift; sourceTree = "<group>"; };
324332
97AC1C072B6A45C9004F0BF4 /* SideWalkValidationForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SideWalkValidationForm.swift; sourceTree = "<group>"; };
325333
97AC1C092B6B7F10004F0BF4 /* CustomVerticalButtonsList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVerticalButtonsList.swift; sourceTree = "<group>"; };
@@ -771,6 +779,15 @@
771779
path = CrossingMarking;
772780
sourceTree = "<group>";
773781
};
782+
97439F762B8729EA00DA43E1 /* CrossingKerbHeight */ = {
783+
isa = PBXGroup;
784+
children = (
785+
97439F772B87444200DA43E1 /* CrossingKerbHeightForm.swift */,
786+
97439F792B87447400DA43E1 /* CrossingKerbHeight.swift */,
787+
);
788+
path = CrossingKerbHeight;
789+
sourceTree = "<group>";
790+
};
774791
97AC1C042B6A44C1004F0BF4 /* SideWalkValidation */ = {
775792
isa = PBXGroup;
776793
children = (
@@ -840,6 +857,8 @@
840857
A475C7D82B5E264700BABEDA /* OSMWay.swift */,
841858
A475C7DC2B5E3E7C00BABEDA /* OSMPayload.swift */,
842859
970D5BD42B677CC500C20BE7 /* OSMUserData.swift */,
860+
97A014BE2B7B580700F7C277 /* OSMMapData.swift */,
861+
97A014C02B7C95A500F7C277 /* OSMElement.swift */,
843862
);
844863
path = models;
845864
sourceTree = "<group>";
@@ -1014,6 +1033,7 @@
10141033
A4E7119C2B57A22300C9DE08 /* quests */ = {
10151034
isa = PBXGroup;
10161035
children = (
1036+
97439F762B8729EA00DA43E1 /* CrossingKerbHeight */,
10171037
971F9FE22B84ABA6005397CC /* CrossingType */,
10181038
971F9FDD2B847318005397CC /* CrossingIsland */,
10191039
18EC425A2B8497F200DE05D7 /* TactilePavingCrosswalk */,
@@ -1546,6 +1566,7 @@
15461566
buildActionMask = 2147483647;
15471567
files = (
15481568
A40E726E2B5D462A00328848 /* osmapi.docc in Sources */,
1569+
97A014C12B7C95A500F7C277 /* OSMElement.swift in Sources */,
15491570
A40E728D2B5D494100328848 /* OSMLogin.swift in Sources */,
15501571
A40E72892B5D487C00328848 /* OSMConfig.swift in Sources */,
15511572
A475C7E02B5E4B6E00BABEDA /* OSMXMLBuilder.swift in Sources */,
@@ -1555,6 +1576,7 @@
15551576
A475C7D32B5E22C800BABEDA /* OSMNode.swift in Sources */,
15561577
A475C7D92B5E264700BABEDA /* OSMWay.swift in Sources */,
15571578
A475C7DD2B5E3E7C00BABEDA /* OSMPayload.swift in Sources */,
1579+
97A014BF2B7B580700F7C277 /* OSMMapData.swift in Sources */,
15581580
970D5BD52B677CC500C20BE7 /* OSMUserData.swift in Sources */,
15591581
);
15601582
runOnlyForDeploymentPostprocessing = 0;
@@ -1649,6 +1671,7 @@
16491671
973FC0382B59363C00878269 /* TactilePavingSteps.swift in Sources */,
16501672
973FC0192B4FB17000878269 /* LocalizedStrings.swift in Sources */,
16511673
FAC9E6112B06811300E2C608 /* LocationManager.swift in Sources */,
1674+
97439F782B87444200DA43E1 /* CrossingKerbHeightForm.swift in Sources */,
16521675
A4834A3F2B67737500D4F0AA /* StoredChangeset.swift in Sources */,
16531676
973FC02F2B58F81F00878269 /* StepsRamp.swift in Sources */,
16541677
971F9FE62B84CDCE005397CC /* CrossingTypeForm.swift in Sources */,
@@ -1695,6 +1718,7 @@
16951718
971F9FDF2B847349005397CC /* CrossingIslandForm.swift in Sources */,
16961719
05DBBB5F2B1263FF00B6F110 /* DatabaseConnector.swift in Sources */,
16971720
FAF44FC12B30850A004FE664 /* OnboardingView3.swift in Sources */,
1721+
97439F7A2B87447400DA43E1 /* CrossingKerbHeight.swift in Sources */,
16981722
971F9FE12B847358005397CC /* CrossingIsland.swift in Sources */,
16991723
970D5BD12B62B61300C20BE7 /* MapViewController.swift in Sources */,
17001724
0536DD972B0BD95100B04C4B /* URLSession+Extension.swift in Sources */,

GoInfoGame/GoInfoGame/AppQuestManager.swift

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66
//
77

88
import Foundation
9-
import SwiftOverpassAPI
9+
//import SwiftOverpassAPI
1010
import osmparser
1111
import MapKit
12+
import osmapi
1213

1314

1415
// Class that handles data handling and display of annotations
1516
class AppQuestManager {
1617

17-
let opManager = OverpassRequestManager()
18+
// let opManager = OverpassRequestManager()
1819

1920
let dbInstance = DatabaseConnector.shared
20-
21+
let osmConnection = OSMConnection()
2122

2223
static let shared = AppQuestManager()
2324
private init() {}
@@ -31,14 +32,35 @@ class AppQuestManager {
3132
// Fetch the quests for a bounding box
3233
func fetchData(fromBBOx bbox: BBox,completion: @escaping () -> Void){
3334
// Get the data from bbox
34-
opManager.fetchElements(fromBBox: bbox) { fetchedElements in
35-
// Get the count of nodes and ways
36-
let allValues = fetchedElements.values
37-
let allElements = allValues.filter({!$0.tags.isEmpty})
38-
print("Saving tags")
39-
self.dbInstance.saveElements(allElements) // Save all where there are tags
40-
completion()
35+
let centralLocation = CLLocation(latitude: 37.7749, longitude: -122.4194) // San Francisco coords
36+
let distance = 100
37+
//37.41465820658871,-122.0912196996173,37.42366839341129,-122.0799229003827
38+
let boundingCoordinates = centralLocation.boundingCoordinates(distance: CLLocationDistance(distance))
39+
40+
osmConnection.fetchMapData(left:bbox.minLon , bottom:bbox.minLat , right:bbox.maxLon , top:bbox.maxLat ) { result in
41+
switch result {
42+
case .success(let mapData):
43+
let response = Array(mapData.values)
44+
let allValues = response
45+
let allElements = allValues.filter({!$0.tags.isEmpty})
46+
print("Saving tags")
47+
DispatchQueue.main.async {
48+
self.dbInstance.saveOSMElements(allElements) // Save all where there are tags
49+
completion()
50+
}
51+
case .failure(let error):
52+
print("error")
53+
}
54+
4155
}
56+
// opManager.fetchElements(fromBBox: bbox) { fetchedElements in
57+
// // Get the count of nodes and ways
58+
// let allValues = fetchedElements.values
59+
// let allElements = allValues.filter({!$0.tags.isEmpty})
60+
// print("Saving tags")
61+
// self.dbInstance.saveElements(allElements) // Save all where there are tags
62+
// completion()
63+
// }
4264
}
4365

4466

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "kerb_height_flush.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "kerb_height_lowered.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "kerb_height_lowered_ramp.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "kerb_height_no.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}

0 commit comments

Comments
 (0)