Skip to main content
CockroachDB supports efficiently storing and querying spatial data. See the links below for more information about how to use CockroachDB for spatial use cases.

Getting Started

Migrating spatial data into and out of CockroachDB

Reference

  • Refer to

Spatial objects

Data representations

Spatial functions

In addition to the , we have written additional documentation for the following functions, including examples:

Known limitations

  • Not all PostGIS spatial functions are supported.
  • The AddGeometryColumn only allows constant arguments.
  • The AddGeometryColumn spatial function only allows the true value for its use_typmod parameter.
  • CockroachDB does not support the @ operator. Instead of using @ in spatial expressions, we recommend using the inverse, with ~. For example, instead of a @ b, use b ~ a.
  • CockroachDB does not yet support s into the . This limitation also blocks the ogr2ogr -f PostgreSQL file conversion command.
  • CockroachDB does not yet support k-nearest neighbors.
  • CockroachDB does not support using to refer to with type modifiers (e.g., public.geometry(linestring, 4326) ). Instead, use fully-unqualified names to refer to data types with type modifiers (e.g., geometry(linestring,4326) ).
  • Defining a custom SRID by inserting rows into is not currently supported.
  • Clusters that mix s390x with other CPU architectures are unsupported for geospatial workloads. Due to differences in how trigonometric functions are computed on s390x systems, geospatial queries in heterogeneous clusters with s390x are likely to get incorrect results. This can include taking a backup on one architecture and restoring it on another.
  • are disabled on ARM Macs due to an issue with macOS code signing for the GEOS libraries. Users needing spatial features on an ARM Mac may instead use Rosetta to or use the distribution.

See also