Geography Reference
In-Depth Information
The geometry_columns Table
The
geometry_columns
table describes the spatially enabled tables in
your database. Many application programs rely on the records in
geom-
etry_columns
to determine which tables are spatial tables. This table, as
well as
spatial_ref_sys
, is described in the OpenGIS Simple Features Spec-
ification for SQL.
7
We can view the structure of the
geometry_columns
table using the
\d
command in the
psql
interactive terminal:
desktop_data=
# \d geometry_columns
Table "public.geometry_columns"
Column | Type | Modifiers
-------------------+------------------------+-----------
f_table_catalog | character varying(256) | not null
f_table_schema | character varying(256) | not null
f_table_name | character varying(256) | not null
f_geometry_column | character varying(256) | not null
coord_dimension
| integer
| not null
srid
| integer
| not null
type
| character varying(30)
| not null
Indexes:
"geometry_columns_pk" PRIMARY KEY, btree (f_table_catalog, f_table_schema,
f_table_name, f_geometry_column)
The first three columns provide a fully qualified name for a table. Some
databases may use “catalog,” and since the
geometry_columns
table is a
standard, it is included in every OGC-compliant implementation. Post-
greSQL doesn't use the concept of a “catalog,” so this column will
always be blank. By default, all tables in PostgreSQL are placed in
the “public” schema. So for a PostGIS-enabled table, we will find the
f_table_schema
and
f_table_name
populated with “public” and the table
name, respectively.
The
f_geometry_column
contains the name of the column in your spa-
tial table that contains the geometry. The
coord_dimension
contains the
dimension of the features (2, 3, or 4). The
srid
is the spatial reference ID
column and contains a number that is related to the
srid
column in the
spatial_ref_sys
table. This defines the coordinate system for the table. The
type
field contains information about the feature type contained in the
table and contains a keyword such as POINT, LINESTRING, POLYGON,
and the MULTI forms of each feature.
With this information, a client application (in other words, your desktop
GIS) can quickly determine which spatially enabled tables are available
7.
Search WWH ::
Custom Search