views:

76

answers:

1

Hi

I am looking into writing an Android app that has a database of approximately 2000 longitudes and latitudes which are effectively hard coded.

I assume that once my app is installed, I can put this information into the SQLite database, but how should I distribute this information when the app is downloaded?

One option I thought of was some kind of Patricia Trie to minimise the size of the data (the points will be in a number of clusters, rather than evenly distributed), but I'm not sure whether such a collection would work when there are two associated numbers to store, along with perhaps some other information such as place name.

Does anyone have any thoughts, input or suggestions?

Rich

A: 

2000 ints is not many.

In fact I recently tried to load up my web app that has similar numbers for lat lon. I realized i need to optimize a bit, but its load time wasn't completely terrible.

You may want to just request the data you need at any given moment. There must be some other data associated with the lat lons that can help you with that... or maybe you should only display pins within some boundary of lat lon, like +1,-1 in every direction of the center of your map or something.

Parris
Yes, you're right, it's not a massive amount of data. I spose I would at least like to dream that in future I would need to store a massive amount of data efficiently, and wanted to do it right the first time around :)
Rich
Oh I almost forgot. In my application I have data stored as a tree in mysql. That is I have a lft and rght value for each of my nodes and then they can be searched for in a threaded kind of way. most of this is handled through cakephp's tree behavior. It automatically sets lft and rght based on god knows what, but it seems to work just fine.
Parris
one more note... if i were to restructure this data off the top of my head I would attempt to make it a quadtree, octtree, or some sort of 2d or 3d datastructure depending on what data I am looking for. It ends becoming a tree, and you may be required to save data into sql lite, or mysql in an interesting way, the look up may indeed be faster and potentially only have 1 highly optimized query.
Parris