> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Well Known Binary

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

The Well Known Binary format (hereafter *WKB*) provides a non-textual, binary representation of a geometric shape. It is used to:

* Allow shapes to be transferred between CockroachDB and a <InternalLink path="cockroach-sql">SQL client</InternalLink> or <InternalLink path="build-a-java-app-with-cockroachdb">application</InternalLink>.
* Provide a portable binary format that can be read across different platforms.

WKB is obtained by serializing a shape as a sequence of numbers. For more detailed information about the structure of the WKB format, see the diagrams showing WKB integer codes in the [OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture](https://portal.opengeospatial.org/files/?artifact_id=25355).

<a id="ewkb" />

The Extended Well Known Binary (*EWKB*) format is the same as WKB, with an <InternalLink path="architecture/glossary#srid">SRID</InternalLink> representation prepended to the data structure.

## See also

* <InternalLink path="spatial-data-overview">Spatial Data Overview</InternalLink>
* <InternalLink path="spatial-tutorial">Spatial tutorial</InternalLink>
* <InternalLink path="spatial-indexes">Spatial indexes</InternalLink>
* <InternalLink path="architecture/glossary">Spatial and GIS Glossary of Terms</InternalLink>
* [OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture](https://portal.opengeospatial.org/files/?artifact_id=25355)
* <InternalLink path="well-known-text">Well known text</InternalLink>
* <InternalLink path="geojson">GeoJSON</InternalLink>
* <InternalLink path="srid-4326">SRID 4326 - longitude and latitude</InternalLink>
* [Introducing Distributed Spatial Data in CockroachDB](https://www.cockroachlabs.com/blog/spatial-data/) (blog post)
* <InternalLink path="geoserver">Using GeoServer with CockroachDB</InternalLink>
