0

I want to import OSM data into postgresql with imposm. How do I have to modify the import process in order to have the user name as an attribute in my tables? Do I have to change that in the data mapping file?

  • I have never used imposm but I would guess that this is what you should edit by adding the "osm_user" tag: bitbucket.org/olt/imposm/src/tip/imposm/defaultmapping.py – user30184 Nov 18 '14 at 21:17
  • @user30184 I tried your idead, but it doesn't work. "osm_user" is not a real tag unfortunately. – ustroetz Nov 19 '14 at 15:28
  • Sorry, I did not mede a proper check before writing. It seems to be only "user" in the data. See wiki.openstreetmap.org/wiki/OSM_XML and sample data with <node id="298884269" lat="54.0901746" lon="12.2482632" user="SvenHRO" . – user30184 Nov 19 '14 at 15:42
  • "user" is in postgres already reserved for the database user. So if I add the field "user" to the mapping file, I'll end up with the database user. – ustroetz Nov 19 '14 at 21:24
  • Hmm, tricky. Perhaps you should contact imposm developers and hope that they can tell you what to do with the reserver keyword. A workaround that should work is to download OSM data in OSM XML format and change all occasions of user= into osm_user= with sed or some other editor. – user30184 Nov 19 '14 at 21:59
1

I believe adding the osm user name or osm user id is out of the design scope of imposm. I don't know if the design goals are any different for the rewrite of the tool in Google's go language. Imposm wants to be fast at helping you create maps and does not appear to be interested in other data that may be used for statics or does not add to map data. Most imposm examples show tag filters because of imposm's design goals. Callbacks are What you are looking for. Here's a stat parser discussion that includes information from imposm's author. The final code is on github with the added timestamp. If you can adapt Martijn's code and use it in place of the original imposm parser code, then you are good to go. Otherwise, the answer is no.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.