// the find
paulmach/orb
Types and utilities for working with 2d geometry in Golang
orb is a Go library for 2D geometric types and operations, covering everything from basic point/polygon types to GeoJSON, Mapbox Vector Tiles, WKB/EWKB encoding, and spatial algorithms. It's aimed at Go developers building mapping tools, processing geospatial data from PostGIS, or generating map tiles — not GIS analysts, Go programmers who need geometry primitives without pulling in a full GIS stack.
The type design is genuinely good: Point as [2]float64 and LineString as []Point means you use append, len, and slice notation naturally instead of fighting an API. The geo vs. planar split is the right call — computing distance on a sphere and area on a flat projection are different operations, and burying that difference in one package would cause silent bugs. WKB scanning directly into orb types via ewkb.Scanner is the kind of PostGIS integration that saves real boilerplate. The tilecover package, which figures out which map tiles a geometry intersects, is non-trivial work that's hard to find elsewhere in Go.
No spatial predicates — there's no Contains, Intersects, or Within. You get clipping and simplification but you can't ask whether polygon A overlaps polygon B without writing it yourself or pulling in a separate library. The quadtree implementation is a nearest-neighbor structure, not a general spatial index, so range queries by bounding box aren't directly supported. At 1.1k stars after several years, the community is small — issues sit unanswered and the changelog shows long quiet periods, so if you hit an edge case in the MVT encoder or a subtle clipping bug you're likely on your own.