finds.dev← search

// the find

manuelbieh/geolib

★ 4,274 · JavaScript · MIT · updated Apr 2026

Zero dependency library to provide some basic geo functions

Geolib is a zero-dependency TypeScript library for 2D geospatial calculations: distances, bearings, polygon containment, bounding boxes, and coordinate format conversion. It targets any JavaScript environment — browser, Node, bundlers — and covers the 80% of geo math that most apps actually need without pulling in a full GIS stack. The 3.x rewrite cleaned up years of inconsistent API debt and made everything pure functions.

1. Every function is pure and side-effect-free — same inputs, same outputs, easy to test and compose. 2. Dual formula support for distance: fast Haversine (getDistance) vs. slower Vincenty (getPreciseDistance), with the slower one injectable into any function that uses distance internally. 3. Flexible coordinate input — accepts lat/lng object variants, GeoJSON arrays, and sexagesimal strings interchangeably, which saves you from writing a normalizer. 4. Tree-shakeable ES module build: each function lives in its own file, so bundlers can strip everything you don't use.

1. Strictly 2D — altitude is explicitly unsupported, which is a hard blocker for anything involving elevation, 3D routing, or drone/flight use cases. 2. isPointInPolygon uses a basic ray-casting algorithm with no handling for complex polygons (self-intersecting, holes, antimeridian crossing) — the removed isPointInsideRobust was the honest signal here. 3. findNearest is O(n) because it just wraps orderByDistance — fine for small arrays, unusable if you're querying thousands of points and need spatial indexing. 4. Last meaningful feature work appears to have stalled; the changelog shows no new functions added since the 3.0 rewrite, and the 2D limitation has been on the roadmap but unaddressed for years.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →