concept case in category postgis

appears as: cases, case, case, cases
PostGIS in Action, Third Edition

This is an excerpt from Manning's book PostGIS in Action, Third Edition.

Many native PostGIS functions don’t support curved geometries. You can find a full list of functions that do support curved geometries in the PostGIS reference manual. Again, for cases where you need to use functions that don’t support curved geometries, you can apply the ST_CurveToLine and then apply the ST_LineToCurve function to convert back if needed.

Once measures start to cross continents and oceans, as is the case with areas and perimeters of entire continents or long air travel routes, planar measures deteriorate rapidly. You’ll have to use geodetic measurements in these cases, where you must consider the spherical nature of the earth. A geodetic measurement models the world as a sphere or spheroid. Coordinates are expressed using degrees or radians. The classic SRID 4326 (WGS 84 lon/lat) is the most common geodetic spatial reference system in use today.

Listing 6.10. Centroid and point on surface of various geometries
SELECT
    name,
    ST_AsEWKT(ST_Centroid(geom)) As centroid,
    ST_AsEWKT(ST_PointOnSurface(geom)) As point_on_surface,
    CASE WHEN ST_GeometryType(geom) ILIKE '%Point%'
      THEN ST_AsEWKT(ST_GeometricMedian(geom))
      ELSE NULL END As geom_median
FROM (VALUES
    ('Multipoint',ST_GeomFromText('MULTIPOINT(-1 1,0 0,2 3)')),
    ('Multipoint 3D',ST_GeomFromText('MULTIPOINT(-1 1 1,0 0 2,2 3 1)')),
    ('Multilinestring',
        ST_GeomFromText('MULTILINESTRING((0 0,0 1,1 1),(-1 1,-1 -1))')
    ),
    ('Polygon',ST_GeomFromEWKT('
        POLYGON(
            (-0.25 -1.25,-0.25 1.25,2.5 1.25,2.5 -1.25,-0.25 -1.25),
            (2.25 0,1.25 1,1.25 -1,2.25 0),
            (1 -1,1 1,0 0,1 -1)
        )')
    )
)
As x(name,geom);