TaskarCenterAtUW / iOSPointMapper

2 stars 0 forks source link

TODO: Separate the device-location detection and POI location calculation components of ObjectLocation file #28

Open himanshunaidu opened 18 hours ago

himanshunaidu commented 18 hours ago

Currently, the entire ObjectLocation instance is being passed to ContentView, so that we get the location of the device at the moment the image was captured. But the ObjectLocation contains a lot more than just the device location logic. It also contains the logic to calculate the location of a segmented POI (Point of Interest).

Thus, it would be prudent to separate the two functionalities. This would also have the advantage of making the POI location calculation more modular, thus more extensible, in case we want to accommodate some kind of conditional logic, or more complex logic (e.g. trimmed mean)

himanshunaidu commented 18 hours ago

Defined here: https://github.com/TaskarCenterAtUW/iOSPointMapper/blob/b93a57e211ea4e2f49269f466ca6e6a96948a867/IOSAccessAssessment/Views/ContentView.swift#L54-L56

himanshunaidu commented 18 hours ago

Reference here in ContentView (all for simply the device location): https://github.com/TaskarCenterAtUW/iOSPointMapper/blob/b93a57e211ea4e2f49269f466ca6e6a96948a867/IOSAccessAssessment/Views/ContentView.swift#L65-L68

https://github.com/TaskarCenterAtUW/iOSPointMapper/blob/b93a57e211ea4e2f49269f466ca6e6a96948a867/IOSAccessAssessment/Views/ContentView.swift#L88-L92

himanshunaidu commented 18 hours ago

In AnnotationView: https://github.com/TaskarCenterAtUW/iOSPointMapper/blob/b93a57e211ea4e2f49269f466ca6e6a96948a867/IOSAccessAssessment/Views/AnnotationView.swift#L15-L18

https://github.com/TaskarCenterAtUW/iOSPointMapper/blob/b93a57e211ea4e2f49269f466ca6e6a96948a867/IOSAccessAssessment/Views/AnnotationView.swift#L74-L78