Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need for Postgis when Postgres already has geo type

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).

like image 658
David542 Avatar asked Feb 28 '26 13:02

David542


1 Answers

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 abstract 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:

  • PostGIS convert meters to degree using epsg 5186
  • Getting all Buildings in range of 5 miles from specified coordinates
  • Postgres - Calculate distance with postgis
  • Buffers (Circle) in PostGIS
like image 153
Jim Jones Avatar answered Mar 02 '26 14:03

Jim Jones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!