[OSM-dev] Problem setting up a play database for use with Rails

Brett Henderson brett at bretth.com
Thu Jul 19 23:46:01 BST 2007


Frederik Ramm wrote:
> I set up rails, created the empty database, and ran osmosis on a planet 
> file to load it. Then copied data from the history tables into the 
> current tables. Not having history data is acceptable in my case.
>
> However, I'm still suffering from the fact that osmosis has created 
> "NULL" timestamps and "NULL" user ids, which subsequently causes the 
> rails API to bail out in places like
>
>      elsif self.user.data_public?
>
> or
>
>      el1['timestamp'] = self.timestamp.xmlschema
>
> (both in way.rb).
>
> Will I get away with just creating one user and then doing something like
>
> update current_ways set timestamp=123456789,user_id=1;
>
> (and same for nodes & segments), or will this cause trouble somewhere 
> else? Anything else I need to do? There must be some people who have 
> already run the rails API from a planet file locally - no?
>
> Bye
> Frederik
>
>   
I think the timestamp problem will be fixed in later versions of 
osmosis.  I uploaded a 0.3 version in recent hours, it may be worth 
trying that.  Of course I'm not expecting other people to do my unit 
testing for me so just telling me what changes you had to make manually 
to the database would be greatly appreciated.

I'll welcome any suggestions on how to resolve the user id issue, 
perhaps I should always create an osmosis user in the database and 
assign all records to it ...

The latest version also populates current tables but unfortunately I'm 
finding it incredibly slow (approx 3 hours).  I suspect again that it is 
related to indexing, there's no nice "disable keys" functionality for 
InnoDB tables that I can find.  Short of deleting and recreating indexes 
afterwards I don't know how to solve this one.  I'm hitting the 10% of 
work that takes 90% of development time problem ...

I've tested recent imports using the Potlatch editor which worked 
properly.  I didn't try the API though ...






More information about the dev mailing list