Introduction
Geometry vs. Geography
Summary

Instruction

Great! There are two additional functions that offer quasi-support geography columns:

  • ST_Buffer,
  • ST_Intersection.

An example query for creating a buffer of 1 km around Alaska may look like this:

SELECT
  ST_Buffer(boundaries,1000) 
FROM usa_states 
WHERE name = 'Alaska';

What do we mean by quasi-support? Well, these two functions do accept geography parameters, but internally, they still perform calculations using geometry type. PostGIS will look for the best projection available when performing calculations with these functions, but this still means that the results can be inaccurate, even though they will be cast back to geography.

Exercise

Find a buffer of 100 kilometers around Florida.

Take a look at the result on the map.

Stuck? Here's a hint!

Use ST_Buffer with the second argument as 100000.

Console

Code editor

Result

TableConsoleMap