11

After looking through web and Postgis in action book I still don't get 4326 geometry vs geography idea.

As I understand geometry is a projection of a map to a surface, and geography is 3d representation (WGS86 Model).

If both of them are 4326, what are benefits of using one over the other and what would be such cases.

I know that geometry is having more functions, and as they state , those functions can be much faster than geography, but then what is use for geography model if you can use 4326 geometry?

Edit: When I speak about geometry, I only mean 4326, not other ones.

Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
user505160
  • 1,176
  • 8
  • 25
  • 44
  • See also the answers over at: https://gis.stackexchange.com/questions/6681/what-are-the-pros-and-cons-of-postgis-geography-and-geometry-types – Arto Bendiken Jul 24 '15 at 23:49

2 Answers2

15

There is a big difference. Geography is much more precise, though much more resource intensive. Geometry will eg produce distances in the SRID units (degrees) that have little meaning to you. Geometry treats lines as lines in the projected surface while in reality directs from point A to point B are arcs of great circles (meaning geometry will return incorrect results for intersections etc).

In short, geometry uses planar geometry vs geodetic calculations on an ellipsoid.

Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
DennisP
  • 158
  • 1
  • 7
-13

The documentation should answer most of your questions, and even has a FAQ section on this specific topic. Choosing which type to use really depends on what you are doing with your data.

But to clear up some misconceptions in your question: no, geography is not necessarily a 3D representation. Both types support 2D and 3D geometric representations.

Mike T
  • 41,085
  • 18
  • 152
  • 203
  • 26
    why cant you just answer? these answers are the most annoying. – user1413824 Aug 24 '14 at 17:28
  • 12
    From the StackOverflow FAQ: "Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline." – snorbi Sep 22 '14 at 06:32