CREATE TABLE geom (g GEOMETRY); 

Columns with a spatial data type can have an SRID  attribute, to explicitly indicate the spatial reference system (SRS) for values stored in the column. For example: 

CREATE TABLE geom ( p POINT SRID 0, g GEOMETRY NOT NULL SRID 4326 ); 

SPATIAL  indexes can be created on spatial columns if they are NOT NULL  and have a specific SRID, so if you plan to index the column, declare it with the NOT NULL  and SRID  attributes: 

CREATE TABLE geom (g GEOMETRY NOT NULL SRID 4326); 

InnoDB  tables permit SRID  values for Cartesian and geographic SRSs. MyISAM  tables permit SRID values for Cartesian SRSs. 

The SRID  attribute makes a spatial column SRID-restricted, which has these implications: 

•The column can contain only values with the given SRID. Attempts to insert values with a different SRID produce an error. 

•The optimizer can use SPATIAL  indexes on the column. See Section 8.3.3, “SPATIAL Index Optimization” . 

Spatial columns with no SRID  attribute are not SRID-restricted and accept values with any SRID. However, the optimizer cannot use SPATIAL  indexes on them until the column definition is modified to include an SRID  attribute, which may require that the column contents first be modified so that all values have the same SRID. 

For other examples showing how to use spatial data types in MySQL, see Section 11.4.6, “Creating Spatial Columns” . For information about spatial reference systems, see Section 11.4.5, “Spatial Reference System Support” . 

## 11.4.2 The OpenGIS Geometry Model 

The set of geometry types proposed by OGC’s SQL with Geometry Types  environment is based on the OpenGIS Geometry Model . In this model, each geometric object has the following general properties: 

•It is associated with a spatial reference system, which describes the coordinate space in which the object is defined. 

## 11.4.2.1 The Geometry Class Hierarchy 

•It belongs to some geometry class. 

The geometry classes define a hierarchy as follows: 

• Geometry  (noninstantiable) 

• Point  (instantiable) 

• Curve  (noninstantiable) 

• LineString  (instantiable) 

• Line 

