2

I'm currently creating an iOS app with Swift 4. I'm using Firebase for data storage.

I'm trying to find out what the best way to handle GIS.

Basically, the user will record an activity that will have a lot of waypoints which together will make the activity polyline.

I understand that Strava (a popular activity tracking app) is using OpenStreetMap but with a custom routing engine.

I don't need a routing agent, but I need to be able to calculate distance, moving time, elevating gain, identify the location/region the activity was conducted etc.

First off. I'm using firebase to store all activity data and images etc. However, will it also be suitable for handling GPS data?

First I will need to store all waypoints for an activity. Below is a structure that I think might work. I assume I will need a timestamp for the waypoint to be able to sort them in the right order? Or is there a better way to handle this?

activity_id (auto generates unique id)
  activityName: "an activity name"
  waypoints
      waypoint_id (auto generates unique id)
        timestamp: 
        lat: "latitude"
        lon: "longitude"
      waypoint_id (auto generates unique id)
        timestamp: 
        lat: "latitude"
        lon: "longitude"

activity_id (auto generates unique id)
  activityName: "an activity name"
  waypoints
      waypoint_id (auto generates unique id)
        timestamp: 
        lat: "latitude"
        lon: "longitude"
      waypoint_id (auto generates unique id)
        timestamp: 
        lat: "latitude"
        lon: "longitude"

Data structure built on info from this post How to save tracking polylines in database?

Given that this data structure is efficient and Firebase is a good alternative for storage.

  • Can I based on this data, calculate distance, elevation, moving_time, and find location efficiently via Swift?

Sorry. This was a lot of question. Hope you can help point me in the right direction.

While waiting for some response I've done some further digging.

  • You've obviously put time time into this question and while it's a good question it's not appropriate for this site. Firebase can do everything you are asking but without showing code as to what you've tried, it's really asking for opinions. My question is; what is preventing you from writing this app? Where is it not working? Please take a moment and review [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). Oh, and can you do this in Swift? absolutely! – Jay Nov 08 '17 at 18:40

0 Answers0