[GIS] For which operations a PostGIS Geography index is useful

geography-data-typepostgispostgis-2.0spatial-index

I need to do KNN- and within-region queries for POI data. I store the POI locations in a geography column. Since I understand that ST_DISTANCE doesn't use the geography index, I added a geometry index in order to use the <-> operator with indexed performance. This works nicely (unfortunately not over the 180° meridian but that's OK in my case).

Now I'm asking myself for which operations a geography index is actually useful?

Best Answer

This tutorial/explanation seems to contradict your question's premise(?). But the pertinent part says:

The difference is under the covers: the geography index will correctly handle queries that cover the poles or the international date-line, while the geometry one will not. There are only a small number of native functions for the geography type:

    ST_AsText(geography) returns text
    ST_GeographyFromText(text) returns geography
    ST_AsBinary(geography) returns bytea
    ST_GeogFromWKB(bytea) returns geography
    ST_AsSVG(geography) returns text
    ST_AsGML(geography) returns text
    ST_AsKML(geography) returns text
    ST_AsGeoJson(geography) returns text
    ST_Distance(geography, geography) returns double
    ST_DWithin(geography, geography, float8) returns boolean
    ST_Area(geography) returns double
    ST_Length(geography) returns double
    ST_Covers(geography, geography) returns boolean
    ST_CoveredBy(geography, geography) returns boolean
    ST_Intersects(geography, geography) returns boolean
    ST_Buffer(geography, float8) returns geography [1]
    ST_Intersection(geography, geography) returns geography [1]
Related Question