Question

I was wondering what approach is recommended for storing an array of CLLocation objects (forming a route or path) in a Core Data database? Is serialization a good approach or would you recommend to store the CLLocation objects in a separate model that has relationship to a "route" model?

The problem with serializing the array of locations is that you don't have easy access to the individual locations. On the other hand, storing each location of the route/path as a separate entry in the database seems to result in a large database and might result in slow performance.

I'm curious to hear your suggestions.

Bart

Was it helpful?

Solution 2

The solution that best fits my needs is to store the location data as doubles by storing latitude and longitude separately. Searching is slightly more complex as a result, but this approach seems better than any other approach I have come across so far.

I have to note that there are reports of developers experiencing problems with this approach in terms of problems with the accuracy (significant digits) when retrieving the stored data. This thread is one such example.

OTHER TIPS

For one of an app I've code, I've store them to a string as described in the Google map API.

http://code.google.com/apis/maps/documentation/directions/

Polyline algorithm

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top