I am importing north-america osm data using osm2pgsql in slim mode. i am only importing roads data. after import the total size of the db around 45gb. most of the space is occupied by planet_osm_nodes and planet_osm_ways. I know i can use --drop option and the size will dramatically increase but that would not allow updating the database. Will I be able to update the database if i truncate these tables after update? i see that the updates run just fine but I think i might be missing something as i am new to the whole osm thing.

asked 07 Aug, 14:29

aitizazk's gravatar image

aitizazk
21110
accept rate: 0%


Truncating the tables is unlikely to work.

What osm2pgsql does when importing is to build the geometry for the roads by going through the list of nodes in a way and building a linestring from the coordinates stored in the nodes. If the geometry of a way changes the linestring is rebuilt, this implies that osm2pgsql needs access to all the original nodes of the way and not just the ones that changed in the diff.

You might be able to save a bit of space by using the --flat-nodes option which stores nodes in a file instead of a database table (see https://github.com/openstreetmap/osm2pgsql/blob/master/docs/usage.md ),

permanent link

answered 07 Aug, 17:56

SimonPoole's gravatar image

SimonPoole ♦
30.4k13238484
accept rate: 18%

edited 07 Aug, 18:03

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:

×143
×115
×115
×22
×3

question asked: 07 Aug, 14:29

question was seen: 130 times

last updated: 07 Aug, 18:03

powered by OSQA