Hey, is it possible to pull out a .osm file from a postgres database. ive got osm data inputted inside a postgresql datbase on my linux server, is it now possible to pull that data out into an osm file Thanks in advance :)

asked 27 Jan, 13:02

shafi-as's gravatar image

shafi-as
106712
accept rate: 0%


If you have imported with osm2pgsql or imposm then the answer is no, you can never go back to the original OSM file because metadata has been lost. You could possibly write code to generate a "pseudo" OpenSteetMap XML but how you would do that, and how useful it would be, depends on the data structure in your PostgreSQL and on what you want to do with the resulting OSM file.

permanent link

answered 27 Jan, 13:52

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
78.1k886911207
accept rate: 24%

1

i have imported using osmosis API DB would it be possible with that

(27 Jan, 14:07) shafi-as

Thanks Frederik for the insight, Also SK53 solution has allowed me to create an osm file from an API DB, for anyone who is looking for a command

sudo osmosis --read-apidb-current host="localhost" database="openstreetmap" user="xxxx" password="xxx" validateSchemaVersion="no" --write-pbf file="file path of where you want it saved and the file type /home/export.osm.pbf"

(28 Jan, 09:40) shafi-as
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×7
×2
×31
×28

question asked: 27 Jan, 13:02

question was seen: 377 times

last updated: 28 Jan, 09:40

powered by OSQA