[Loadstone] Database redesign

Shawn Kirkpatrick shawn at loadstone-gps.com
Thu May 8 10:58:15 BST 2008

I think your math is a little off when calculating the odds of duplicate 
user ids. You'd have to come up with two different strings that'll produce 
the same crc 16 hash for this to happen.
When a point is created it gets an id and userid, thest don't change. On 
import the points are checked to see if they have an existing id and userid 
and if so the data is updated. If you import out of date data then the 
point's data will also get set to the out of date value. Not much you can do 
about that. A last modified field would be an extra 4 bytes per entry and 
that's just a bit much for the purpose.
The new checkpoints files contain all a point's information. When 
checkpoints are loaded the point's id and userid are looked up in the 
currently loaded database. If found the information from the database is 
used and if not then the information from the file will be used as is. This 
is why your experiment didn't work.
A point typing system may only require one extra byte per entry, you can get 
256 values in that.

On Thu, 8 May 2008, Ari Moisio wrote:

> Hi
> On Wed, 7 May 2008, Shawn Kirkpatrick wrote:
>> The user id might be a problem but not any time soon. Unfortunately every
>  Iirc the birthday theorem we'll get 50 % probability to get duplicate
> userids with 256 users (sqrt(2^16)).
>> byte added to a point record makes the database that much bigger. No point
>> in a last modified field, duplicate checking is done on import.
>   And what will happen if there is a point with  almost similar
> coordinates, different description and similar userid and id fields. How
> does LS know witch is correct?
>> The checkpoints aren't part of the database. They can reference the database
>> on load but that's only to see if the information needs updating. The only
>> difference with a list of route points would be that they're in a particular
>> order. When this is implemented there probably won't be much difference if
>> any between checkpoint format and route point format.
>  How could a non-existent point be checked? If i have understood the
> checkpoint list correctly, please correct me if i'm not,  checkpoint list
> is just a list of coordinates and  with new LS version comments. There are
> also point names and some  other data but they appear to be ignored.
>  I made following experiment; i checked a number of points around my
> current location. Then i saved those points. After saving i edited the
> checkpoint file by either moving the checkpoints from few centimeters to
> few meters. Onther chekpoints i renamed. LS was closed during the
> editting. Afterwards i loaded the modified checkpoint file:
> - Moved checkpoins were not check anymore and there were no references to
> those poins. This means that checkpoint cannot exist without a stored
> point in the database.
> - All so far checked points were named with their original names, ie name
> field in the checkpoint file were ignored.
>> There will be a point typing system of some kind. We'll have to work out
>> what types to implement thoe and how exactly this will work.
>  If there is no room for few bytes for adequate userid i afraid there is
> no room for much classification either.
>> On Thu, 8 May 2008, arimo at iki.fi wrote:
>>> Hi
>>>  If the database will berestructured some day i'll suggest following
>>> changes:
>>> - User id seems to be currently only 16 bit integer. When user base
>>> increase there will a risk of duplicate user ids.
>>> - There could be a  last modified field in the point data. When importing
>>> database  is update only if the imported point is more recent than same
>>> point in the database.
>>> - There could be a new class of points, route points. These points are
>>> sorted list of lat & lon coordinates and a comment. These point have no
>>> relation with the point database and could be freely exchanged with other
>>> users regardless if they have similar points in their databases. Maybe
>>> these routepoints can someday replace current checkpoint system.
>>>  - Personally i do not find much use for separate
>>> point classification data.
>>> - There could be an option to attach a voice  recording to the point. For
>>> practical reasons these recordings will not be   included when exporting
>>> the database.
>>> You can still escape from the Gates of hell: Use Linux!
>>> --
>>> mr. M01510
>>> _______________________________________________
>>> Loadstone mailing list
>>> Loadstone at loadstone-gps.com
>>> http://www.loadstone-gps.com/mailman/listinfo/loadstone
>> _______________________________________________
>> Loadstone mailing list
>> Loadstone at loadstone-gps.com
>> http://www.loadstone-gps.com/mailman/listinfo/loadstone
> You can still escape from the Gates of hell: Use Linux!
> -- 
> mr. M01510
> _______________________________________________
> Loadstone mailing list
> Loadstone at loadstone-gps.com
> http://www.loadstone-gps.com/mailman/listinfo/loadstone

More information about the Loadstone mailing list