0

I can't find a replacement function for geography_typmod_dims which is used in an old application.

In 1.5 there were: geography_typmod_dims, _in, _out, _srid and _type.

In 3.2 I find only: geography_typmod_in and _out.

1

1 Answer 1

0

Here is an old example showing geography_typmod_dims being used to get the coordinate dimensions of a field from the pg_attribute typmod for the field. That is being used to create the coord_dimension field in the postgis.geography_columns view.

Current PostGIS support for geography designates dimensions using M, Z or ZM suffixes on type names.

CREATE TABLE test (
  blank geography(POINT, 4326),
  m     geography(POINTM, 4326),
  z     geography(POINTZ, 4326),
  zm    geography(POINTZM, 4326)
);
db=> SELECT f_table_name, f_geography_column,
            coord_dimension, type
     FROM geography_columns;
 f_table_name | f_geography_column | coord_dimension |  type   
--------------+--------------------+-----------------+---------
 test         | blank              |               2 | Point
 test         | m                  |               3 | PointM
 test         | z                  |               3 | PointZ
 test         | zm                 |               4 | PointZM
(4 rows)

You should be able to replace uses of geography_typmod_dims one of two ways:

  1. If you know the table and column you are dealing with, look it up in the coord_dimensions field of the geography_columns view.
  2. If you need to check the dimensions of a geography object, perhaps you can check the return from ST_Summary for Z, M or ZM and figure out the cases that apply to your application. Looking at the PostGIS Function Support Matrix, ST_Summary is the only function I see that might help you for geography.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.