On this page
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
- Migrate from Shapefiles
- Migrate from GeoJSON
- Migrate from GeoPackage
- Migrate from OpenStreetMap
- Export Spatial Data
Reference
- Spatial indexes
- Spatial and GIS Glossary of Terms
- Refer to Known Limitations
- Spatial functions
- Client library compatibility
Spatial objects
Data representations
Spatial functions
In addition to the generated reference documentation for spatial functions, we have written additional documentation for the following functions, including examples:
ST_ContainsST_ConvexHullST_CoveredByST_CoversST_DisjointST_EqualsST_IntersectsST_OverlapsST_TouchesST_UnionST_Within
Known limitations
- Not all PostGIS spatial functions are supported. #49203
- The
AddGeometryColumnspatial function only allows constant arguments. #49402 - The
AddGeometryColumnspatial function only allows thetruevalue for itsuse_typmodparameter. #49448 - CockroachDB does not support the
@operator. Instead of using@in spatial expressions, we recommend using the inverse, with~. For example, instead ofa @ b, useb ~ a. #56124 - CockroachDB does not yet support
INSERTs into thespatial_ref_systable. This limitation also blocks theogr2ogr -f PostgreSQLfile conversion command. #55903 - CockroachDB does not yet support k-nearest neighbors. #55227
- CockroachDB does not support using schema name prefixes to refer to data types 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)). #56492 - Defining a custom SRID by inserting rows into
spatial_ref_sysis not currently supported. #55903 - Clusters that mix
s390xwith other CPU architectures are unsupported for geospatial workloads. Due to differences in how trigonometric functions are computed ons390xsystems, geospatial queries in heterogeneous clusters withs390xare likely to get incorrect results. This can include taking a backup on one architecture and restoring it on another. #148783 - Spatial features 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 run the Intel binary or use the Docker image distribution. #93161