Home > Software design >  Need for Postgis when Postgres already has geo type
Need for Postgis when Postgres already has geo type

Time:12-07

I'm debating installing the PostGIS extension for Postgres. However, upon looking at the types in Postgres itself, it seems to support the basic Geometric types, including:

8.8.1. Points
8.8.2. Lines
8.8.3. Line Segments
8.8.4. Boxes
8.8.5. Paths
8.8.6. Polygons
8.8.7. Circles

So then, what is the use case for using PostGIS and what would that give me that Postgres itself wouldn't give me when working with spatial data? (Ignoring UI considerations).

CodePudding user response:

It would all depend on your use case. If you're planing to apply simple spatial operations, such as containment or distance, the native geometric data types would do the trick. But here are a few things that speak for PostGIS anyway:

  • PostGIS is a huge open source project in constant development.
  • It has over 1.3k really kickass functions that solve most of the cumbersome math involved in spatio-temporal queries. Think only about operations like Spatial Reference System (SRS) transformations, projections or simply handling polyhedral surfaces and you will soon realize the complexity involved with geo spatial data. Believe me, it is not trivial. Even the simple feature of rendering geo spatial data in different formats like WKT, KML or GeoJSON can save you a lot of time!
  • it enables you to easily access the data from most of modern GI Software. Feel like plotting your data into a map? ;)
  • it can serve as data source for OGC Standard web services, such as Web Feature Service (WFS) or Web Map Service (WMS). Take a look at GeoServer.
  • it is pretty well adopted in the GIS community, which means you will find a vast amount of content and support online.
  • it supports both vector and raster data types.
  • it offers (multidimensional) spatial indexing. Geospatial data sets are known to be huge, so a proper indexing mechanism is imperative to perform spatial operations in a decent query time.
  • it offers network topology support.
  • it is the building block of other pretty handy extensions, e.g. pgRouting and ogrfdw.

The list of advantages goes on and on.

Here a few real life use cases that can be easily addressed with PostGIS:

CodePudding user response:

The Earth's surface is not an infinite 2D plane. How reasonable it is to approximate it as one depends on what you are doing.

  • Related