Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgis 4326 geometry vs geography

Tags:

postgis

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.

like image 532
user505160 Avatar asked Jan 19 '14 12:01

user505160


1 Answers

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.

like image 57
DennisP Avatar answered Nov 10 '22 23:11

DennisP