惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
Jina AI
Jina AI
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
V
V2EX
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
B
Blog
博客园 - 叶小钗
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
A
About on SuperTechFans
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog

Show HN

Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code.
offline land/sea lookup (a Trifold library)
jaakl · 2026-06-12 · via Show HN

landcheck: is this point on land or in the sea?

An offline lookup library built on the Trifold grid. Thanks to exact aperture-4 nesting, the level-10 grid (~7 km cells) classified against Natural Earth collapses into a 182 KB dataset that answers anywhere on Earth in microseconds, with a confidence value for every answer. Python and JavaScript give identical results. This page runs the real JS library in your browser; the dataset is embedded right in this HTML file.

Try it on the map

Interactive demo

Load sample points or your own file (CSV lon,lat or GeoJSON points), and every point is classified in your browser by the bundled library, with no server and no network call per lookup. The lookups-per-second figure is measured tightly around the classification loop on your machine (map rendering and file parsing excluded), so it is the real library throughput. Use the 100k-random button for a stable number.

Controls

Your own points

Open CSV / GeoJSON…

CSV: lon,lat[,name] per line (or a header naming lat/lon columns in either order). GeoJSON: any FeatureCollection of Points. Files stay on your machine.

OSM coastal refinement exact OSM polygon test wherever the coastline crosses a cell (downloads once)

Off: coastal answers use the bundled land-area fraction. On: near-exact coastline. Watch how the counts, confidence and lookup rate change.

Debug layers source coastline (NE, follows the refinement setting)

Click anywhere on the map to see the level-10 triangle and its classification.

land: certain (confidence 1.0)
coast: mixed cell
sea: certain (confidence 1.0)
answer flipped by OSM refinement

Loading dataset…

Click any classified point for its full answer: cell address (computed on the fly for sea points, whose cells are not stored), kind, confidence and land fraction. Note the Natural Earth 1:50m caveats: lakes count as land and islets below its resolution are missing. Switching on the OSM coastal refinement makes OSM authoritative in cells crossed by either source coastline. Try the cities sample with it on and off and compare the answers near coasts.

User guide

JavaScript (browser or Node)

import { LandCheck } from "./landcheck.mjs";

// Node: bundled file · browser: fetch the 182 KB dataset
const lc = await LandCheck.fromFile();              // Node
const lc = await LandCheck.fromUrl("landsea_L10.tfls"); // browser

lc.isLand(24.7536, 59.437);   // true  (lon, lat)
lc.check(-0.1276, 51.5072);
// { land: true, kind: 'land', confidence: 1,
//   landFraction: 1, cell: 'TFA95BM', refined: false }

Python (stdlib only)

from landcheck import LandCheck

lc = LandCheck()                       # bundled data
lc.is_land(24.7536, 59.4370)           # True
lc.check(-0.1276, 51.5072)
# LandResult(land=True, kind='land', confidence=1.0,
#   land_fraction=1.0, cell='TFA95BM', refined=False)

# vectorised: ~2.8 µs/point with numpy
lc.is_land_batch(lons, lats)

What the answer means

kindmeaninglandconfidence
landcell wholly inside landtrue1.0
seacell absent from the datasetfalse1.0
coastmixed cell; bundled land-area fraction decides fraction ≥ 0.5max(f, 1−f)
coast + refineddecided by the optional OSM polygon layer exact0.99

Measured accuracy: 99.82% agreement with exact polygon containment on 30,000 uniform random points. The land and sea answers were 100% correct; all residual error lives in coast answers, which self-report lower confidence. With the OSM refinement loaded, coastal answers reach 99.95%.

Command line

$ python landcheck/python/landcheck.py 24.7536 59.4370
LAND  kind=land  confidence=1.000  land_fraction=1.0  cell=TFAVKGR  refined=False

Technical info

Canonical index

Any Trifold cell at level ≤ 10 maps to addr64 >> 39, a 25-bit integer where a level-l cell covers exactly 410−l consecutive indices. The whole classification becomes run-length intervals.

TFLS format · 182 KB

153,884 runs as varint(gap), varint(len·2|coastal) + a 4-bit land fraction per coastal cell, zlib-compressed. Level-agnostic: the same tooling serves an L8 (~30 KB) or L12 (~3 MB) variant.

Lookup path

Pure-float point location (no dependencies, bit-identical to the SDK) descends 10 subdivision levels, then one binary search over the run starts. ~0.8 µs in Node, ~13 µs in pure Python, ~2.8 µs batched with numpy.

OSM refinement · TFLR

OSM simplified land polygons clipped to every cell crossed by either source coastline, quantized to a cell-local 16-bit grid (~0.1 m), with zigzag-varint rings and the even-odd rule. The OSM polygon test can override Natural Earth land, sea or fraction answers in those cells.

Full documentation, build scripts (build.py, refine_build.py) and the cross-language test suite live in landcheck/ on GitHub. Roadmap: country detection with the same run-length + clipped-border approach, an L12 variant, published pip/npm packages.

Benchmark: Trifold vs SQL spatial engines

Same job for every engine: classify 100,000 sphere-uniform random points against the same OSM simplified land polygons. Median of seven warm runs on an Apple M5 Pro laptop (June 2026); BigQuery ran as a managed on-demand service. In batch mode the OSM-refined Trifold was 3–4× faster than BigQuery and PostGIS and ~30× faster than DuckDB Spatial; called one point at a time it answered ~86,000 lookups per second, 40× the embedded DuckDB rate.

Batch · 100,000 points per call

Trifold base

459,096 pts/s

Singular · one point per call

The SQL engines compute exact polygon containment on the loaded OSM snapshot; Trifold's compact dataset agrees with that result on 99.5% of points (refined). PostGIS singular includes localhost TCP + Docker transport; DuckDB runs embedded in-process. BigQuery's singular mode was not run. Full methodology, dataset manifest and caveats: benchmark.md.