Osm2pgsql/schema

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Osm2pgsql/schema
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português português do Brasil română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

This page summarizes the structure of the PostgreSQL/PostGIS database produced by osm2pgsql, that is the main and most used back-end structure in OSM applications and spatial analysis.

The complete and updated documentation is spread in the following sources:

The basic tables are expressed in this simplifyed UML class diagram of the default import style:

UMLclassOf-osm2pgsql-schema.png

There are no explicit reference (no SQL-expressed foreign key) between tables. Tables of the <<main>> datatype have a way field with the geometry, <<slim>> tables not. The <<dup>> tables are duplicates with enforced type of geometry (roads are enforced to be LineStrings).

A dataflow (production) diagram. The default style is the main answer for  "What does osm2pgsql do?"

Each import style changes tables and fields. Today --slim option is so recommended (not only for performance but also for updates) that we can use it as part of the default.

Database analysis

See: