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

This is a question pertaining to osm2pgsql, osm2pgrouting and nominatim.

As I understand it, these are 'lossy' methods for getting data from OSM and into a PostGIS database.

I was wondering:

  • In which ways are these methods 'lossy' (what data is lost)?

and

  • are there any known methods that are lossless?

asked 30 May '13, 15:31

FortyLashes's gravatar image

FortyLashes
21112
accept rate: 0%

edited 30 May '13, 19:25

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273


Yes, these are lossy methods. For example, osm2pgsql drops coastlines, and the main outputs manipulate data into OGC simple features, which loses information regarding routing relationships.

You can load osm data into postgres in a lossless fashion using osmosis and the --write-apidb or --write-pgsql outputs, depending on what schema you wish to use.

permanent link

answered 30 May '13, 19:12

Andy%20Allan's gravatar image

Andy Allan
12.5k23128153
accept rate: 28%

@Andy Allan Sorry for not getting back sooner! Thank you for that! I have been looking into Osmosis - that is awesome you can do lossless!

(14 Jun '13, 18:06) FortyLashes

The most common lossless DB schemas are apidb, pgsnapshot, pgsimple and OSM3S.

apidb

  • can store history
  • is not spatially enabled
  • uses postgresql
  • takes weeks to import
  • takes more than 1TB

pgsnapshot

  • is current data only
  • is spatially enabled
  • uses postgresql + postgis
  • can have geometries built for ways
  • takes days to import
  • takes a couple hundred GB
  • uses hstore to store tags

pgsimple is pgsnapshot with separate tables for tags instead of hstore

OSM3S

  • is current data only
  • is custom database software
  • is primary used by overpass API

None of them are well-suited for rendering. The main uses for these database types are analysis and when you want to be able to produce a .osm file for an area.

permanent link

answered 14 Jun '13, 20:02

pnorman's gravatar image

pnorman
2.4k52140
accept rate: 18%

-5

I assume that by "OSM data" you mean the OSM source data and by "lossy method" you mean that the output dataset, after processing it by a "method", contains at least one less (missing) or changed object compared to the input dataset. If these assumptions are correct my answers to your questions are:
-Yes, all "methods" are lossy (regardless of the programing language and source type in apps). Namely, the OSM source data contains many (but really many) errors of formal and logical nature. Some of the erroneous objects must be ignored and many of them are changed by a data-preparation "method". But the data-preparation is done by teams and as a rule teams have different filings for criteria what to ignore, what and how to change and so on. Therefor the "lossy" nature of the "methods" considerably vary. In my opinion/experience about 90% of all errors may be repaired.
-Yes, downloading the latest regular OSM dump will provide you with exactly the same objects as they are in the database of the OSM source data.

permanent link

answered 31 May '13, 08:12

sanser's gravatar image

sanser
695383955
accept rate: 5%

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:

×689
×263
×134
×118

question asked: 30 May '13, 15:31

question was seen: 4,612 times

last updated: 14 Jun '13, 20:02

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