[Openstreetmap-dev] key/value system question and broken osmServerHandler.getFeatureValues

SteveC steve at asklater.com
Sun Sep 18 11:44:02 BST 2005


Nick!

Absolutely.

install mysql on your machine

take a look at osmserversqlhandler.java and dao.rb

emulate the sql calls for something like creation, move and deletion of
nodes but for keyval. dao.rb is incomplete.

Instead of inserting lat lon, insert two varchars(255), the key and val

have one keyval table with a tinyint to select keyval type, eg 0 for
point of interest, 1 for line segment, 2 for area

implement this all in functions in dao.rb but don't commit it as it's
production code.

dont use unix timestamp like in the legacy stuff (I'm changing that) use
a datetime column and insert NOW() for each change

figure out the most efficient way to do searches over this data.
probably maintaining some independent index a-la Lucene will be the best
way :-(

dont use the visible in the meta table, but do in the main

then we'll see how it all looks, commit it and we can hook it up to the
API then.


this is what the node and its meta table look like:

mysql> describe nodes;
+-----------+------------+------+-----+---------+-------+
| Field     | Type       | Null | Key | Default | Extra |
+-----------+------------+------+-----+---------+-------+
| uid       | bigint(64) | YES  |     | NULL    |       |
| latitude  | double     | YES  |     | NULL    |       |
| longitude | double     | YES  |     | NULL    |       |
| timestamp | bigint(32) | YES  |     | NULL    |       |
| user_uid  | bigint(20) | YES  |     | NULL    |       |
| visible   | tinyint(1) | YES  |     | NULL    |       |
+-----------+------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

mysql> describe node_meta_table;
+-----------+------------+------+-----+---------+----------------+
| Field     | Type       | Null | Key | Default | Extra          |
+-----------+------------+------+-----+---------+----------------+
| uid       | bigint(64) |      | PRI | NULL    | auto_increment |
| timestamp | bigint(32) | YES  |     | NULL    |                |
| user_uid  | bigint(20) | YES  |     | NULL    |                |
| visible   | tinyint(1) | YES  |     | NULL    |                |
+-----------+------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)



* @ 18/09/05 10:32:48 AM nick at hogweed.org wrote:
> 
> > Cool.
> >
> > My plan is to get the applet talking REST and then complete key/value
> > stuff, possibly closing bug 17 along the way.
> >
> > have fun,
> >
> > SteveC steve at asklater.com http://www.asklater.com/steve/
> 
> Hello Steve,
> 
> Is it still worth me doing any key/value work? I have now completed a 
> dissertation that has been keeping me busy all summer (hence the 
> after-midnight timestamps of any SVN checkins!) and am almost free of 
> commitments for the next two weeks.
> 
> Nick

have fun,

SteveC steve at asklater.com http://www.asklater.com/steve/




More information about the dev mailing list