Spatial fields consist of a series of geometry field types and one raster field
type. Each of the geometry field types correspond to the OpenGIS Simple
Features specification [1]. There is no such standard for raster data.

Choosing an appropriate SRID for your model is an important decision that the
developer should consider carefully. The SRID is an integer specifier that
corresponds to the projection system that will be used to interpret the data
in the spatial database. [3] Projection systems give the context to the
coordinates that specify a location. Although the details of geodesy are
beyond the scope of this documentation, the general problem is that the earth
is spherical and representations of the earth (e.g., paper maps, Web maps)
are not.

Most people are familiar with using latitude and longitude to reference a
location on the earth’s surface. However, latitude and longitude are angles,
not distances. In other words, while the shortest path between two points on
a flat surface is a straight line, the shortest path between two points on a curved
surface (such as the earth) is an arc of a great circle. [4] Thus,
additional computation is required to obtain distances in planar units (e.g.,
kilometers and miles). Using a geographic coordinate system may introduce
complications for the developer later on. For example, SpatiaLite does not have
the capability to perform distance calculations between geometries using
geographic coordinate systems, e.g. constructing a query to find all points
within 5 miles of a county boundary stored as WGS84.
[5]

Portions of the earth’s surface may projected onto a two-dimensional, or
Cartesian, plane. Projected coordinate systems are especially convenient
for region-specific applications, e.g., if you know that your database will
only cover geometries in North Kansas, then you may consider using projection
system specific to that region. Moreover, projected coordinate systems are
defined in Cartesian units (such as meters or feet), easing distance
calculations.

The State Plane Coordinate System: A website covering the various
projection systems used in the United States. Much of the U.S. spatial
data encountered will be in one of these coordinate systems rather than
in a geographic coordinate system such as WGS84.

Defaults to True. Creates a spatial index for the given geometry
field.

Note

This is different from the db_index field option because spatial
indexes are created in a different manner than regular database
indexes. Specifically, spatial indexes are typically created using
a variant of the R-Tree, while regular database indexes typically
use B-Trees.

This option may be used for customizing the coordinate dimension of the
geometry field. By default, it is set to 2, for representing two-dimensional
geometries. For spatial backends that support it, it may be set to 3 for
three-dimensional support.

Note

At this time 3D support is limited to the PostGIS and SpatiaLite backends.

The geography type provides native support for spatial features represented
with geographic coordinates (e.g., WGS84 longitude/latitude). [6]
Unlike the plane used by a geometry type, the geography type uses a spherical
representation of its data. Distance and measurement operations
performed on a geography column automatically employ great circle arc
calculations and return linear units. In other words, when ST_Distance
is called on two geographies, a value in meters is returned (as opposed
to degrees if called on a geometry column in WGS84).

Because geography calculations involve more mathematics, only a subset of the
PostGIS spatial lookups are available for the geography type. Practically,
this means that in addition to the distance lookups
only the following additional spatial lookups are
available for geography columns:

If you need to use a spatial lookup or aggregate that doesn’t support the
geography type as input, you can use the
Cast database function to convert the
geography column to a geometry type in the query: