in reply to Re^2: from osm to mysql
in thread from osm to mysql

This is interesting, thanks for the background. I have only looked as OSM from the point of view of end user apps at this point(android), so the links and info you provide are appreciated.

In answer to your first question: My preference is to use a database if at all possible. For smaller projects I like SQLite, as it is very portable, with the whole data base stored in one file. That limits it in size, but not terribly. I have no porblem sticking 500k records in an SQLite database. If it is likely that your going to have a much larger database, the MySQL is my preference. As erix pointed out, it looks like osm is leaning toward Postres. Postgres is fine, but I worked with it only once years ago, so I am somewhat abivilant towards it. I am sure it would work fine.

As far as methodology goes: You already have your parser pretty much worked out as close as I can tell. I would take the script that you already have, add the DBI/DBD for your chosen database(does not matter from the Perl/DBI standpoint), and then write the rather short code to take your parsed data and insert it to the database. You are really already half done.

You can use SuperSearch and the POD for your chosen database driver, to come up with examples. In simplistic psudo-code it looks a bit like the following:

use DBD::mysql; set up connection (database, user, password) establish connection establish routine to accept parsed values and insert to db run the routine for all your records disconnect from the db;

Again, I hope you find this somewhat helpful...

...the majority is always wrong, and always the last to know about it...

Insanity: Doing the same thing over and over again and expecting different results...

Replies are listed 'Best First'.
Re^4: from osm to mysql - with INSERT
by Perlbeginner1 (Scribe) on May 29, 2014 at 15:08 UTC
    hello dear wjw

    again many many thanks for all your hints; first of all i like the idea of sqlite i have to digg deeper into that next time

    your explanations were very convincing


    At the moment i am willing to store all the data into the MySQL-DB.

    Well - since i want to put all the data ( that i have in a xml-file) into the mysql db - i need to have a INSERT-Statement.

    where to place this INSERT-statement!?
    look forward to hear from you

      Take the pseudocode given to you, implement this in perl, test it. This is not a code writing service.