1. MooseStack
  2. Data Types
  3. Geometry Types

On this page

PointRingLineStringMultiLineStringPolygonMultiPolygonType Mapping Reference

Geometry Types

ClickHouse provides geometry types for spatial data. Moose exposes type-safe helpers that map to the correct ClickHouse representations.

Point

A single coordinate pair [x, y].

import { ClickHousePoint } from "@514labs/moose-lib"; interface Location {  coordinates: ClickHousePoint;    // Point → [number, number]}

Ring

A closed sequence of points forming a boundary (first and last points are the same).

import { ClickHouseRing } from "@514labs/moose-lib"; interface Boundary {  outline: ClickHouseRing;    // Ring → Array<[number, number]>}

LineString

A sequence of connected points forming a line.

import { ClickHouseLineString } from "@514labs/moose-lib"; interface Route {  path: ClickHouseLineString;    // LineString → Array<[number, number]>}

MultiLineString

Multiple line strings.

import { ClickHouseMultiLineString } from "@514labs/moose-lib"; interface Network {  roads: ClickHouseMultiLineString;    // Array<Array<[number, number]>>}

Polygon

A shape defined by an outer ring and optional inner rings (holes).

import { ClickHousePolygon } from "@514labs/moose-lib"; interface Zone {  area: ClickHousePolygon;    // Polygon → Array<Array<[number, number]>>}

MultiPolygon

Multiple polygons.

import { ClickHouseMultiPolygon } from "@514labs/moose-lib"; interface Region {  territories: ClickHouseMultiPolygon;    // Array<Array<Array<[number, number]>>>}

Type Mapping Reference

ClickHouse TypeTypeScriptPython
PointClickHousePointPoint (tuple[float, float])
RingClickHouseRingRing (list[tuple[float, float]])
LineStringClickHouseLineStringLineString (list[tuple[float, float]])
MultiLineStringClickHouseMultiLineStringMultiLineString (list[list[...]])
PolygonClickHousePolygonPolygon (list[list[...]])
MultiPolygonClickHouseMultiPolygonMultiPolygon (list[list[list[...]]])
Coordinate order

Coordinates are represented as [x, y] pairs. For geographic data, this typically means [longitude, latitude].

  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
    • Strings
    • LowCardinality
    • Integers
    • Floats
    • Decimals
    • Booleans
    • Date & Time
    • Network
    • Arrays
    • Maps
    • Nested
    • Tuples
    • Enums
    • Geometry
    • JSON
    • Nullable
    • Aggregates
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506