[OSM-dev] Ruby-port api local use

Jon Burgess jburgess777 at googlemail.com
Wed Jun 18 23:16:30 BST 2008


On Wed, 2008-06-18 at 22:21 +0100, Alex Wilson wrote:
> Hi all,
> 
> A quick and a dumb question: I've been trying to get the ruby port
> working in order to compare the api query from it with the results of
> our C++ implementation of the api. I've imported a uk sub-section of
> world using planetosm-to-db.pl into a mysql db - it seems to be
> successfully populated. The local version of the server is up and
> running and in development mode. However I get errors from the ruby
> when attempting to use the map query. Can anyone help - or tell me
> which M to RTF? The error follows:
> 
> [2008-06-13 18:53:37.575916 #15008] NoMethodError (You have a nil
> object when you didn't expect it!
> The error occurred while evaluating nil.data_public?):
>     /app/models/node.rb:123:in `to_xml_node'

Looks like user=nil which probably means the user table has probably not
been populated. 

When I hit this once before I just changed those lines of ruby to
follow the 'else' part to leave the user blank. You'll need to make the
equivalent change for the ways and relations too.

I've used the osmosis tool to import working data previously. This adds
an osmosis user to the table automatically and imports all the data as
owned by this user. I expect this is the route that most people take to
populate and update a local DB currently.

Another alternative would be to create a new user on the web interface
and then do some manual SQL manipulation to set the userid column of all
the existing data to this user (or change ID of the user to match the
imported data).

	Jon






More information about the dev mailing list