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

From the component overview on the wiki I see that a plain Postgres is used for the main database (marked as "PostgreSQL backend"). What is the reason no GIS database (like PostGIS) is used? Would it not bring any advantages?

I see PostGIS being used in the rendering part of the system. Can someone explain why is it used there?

asked 22 Oct '16, 20:04

Kozuch's gravatar image

Kozuch
1.7k587285
accept rate: 8%


The strength of PostGIS is geometry operations with "simple features" - points, lines, and polygons. PostGIS offers functionality to compute the geometric relation between such features (whether they intersect or touch or contain each other, for example). All this is not required for the central OSM database because in that database, the only geometries that exist are nodes. While ways and relations can be used to form lines and polygons, this is a geometric interpretation that the database is fully ignorant of.

Using PostGIS in the backend would add an unnecessary layer of complexity, and the additional functionality is not useful there.

This is different in the rendering database, where OSM objects are transformed into "simple features" when imported by osm2pgsql (a misnomer really - it should be osm2postgis).

permanent link

answered 22 Oct '16, 22:27

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

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:

×165
×134
×118
×34
×4

question asked: 22 Oct '16, 20:04

question was seen: 2,907 times

last updated: 22 Oct '16, 22:27

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