NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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 '17, 14:29

aitizazk's gravatar image

aitizazk
217710
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, 17:56

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 07 Aug '17, 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:

×263
×205
×167
×35
×8

question asked: 07 Aug '17, 14:29

question was seen: 2,129 times

last updated: 07 Aug '17, 18:03

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum