- When creating shapes. By default, shapes which do not have an SRID associated with them will use an SRID of 0, which means “this shape has no SRID”.
- When comparing shapes. If you try to compare two shapes with different SRIDs using a spatial predicate, CockroachDB will signal an error.
Adding SRIDs to shapes
Add an SRID with WKT
To add an SRID to a shape you are defining with , prepend the text withSRID=N; as shown below:
Add an SRID with SQL
To add an SRID to a shape in SQL, use theST_SetSRID :
Change a shape’s SRID
To convert a shape to use a different SRID while maintaining the same reference location, use theST_Transform function. In the example below, we transform the reference system for a line from Albany, NY to Saranac Lake, NY from 4326 to use the StatePlane New York East reference (SRID 3101). This can be useful (or at least interesting) in some situations, since the StatePlane systems give distances in feet.
When setting a shape’s SRID, you can only use SRIDs that are defined in the table. For more information, see Getting SRID information.
Getting SRID information
You can get more detailed information about the SRIDs supported in CockroachDB from the by querying the table. To see how many SRIDs are supported, run the following query:Comparing shapes with different SRIDs
If you try to compare two shapes with different SRIDs using a spatial predicate, CockroachDB will signal an error:Known limitations
Defining a custom SRID by inserting rows into is not currently supported.

