Coordinates & Spatial Grids
Operations, analytics, and GIS teams constantly exchange locations in different notations — decimal coordinates (37.72047, -122.43765), degrees-minutes-seconds (37°46'29.6"N), Google Plus Codes (849VQHFQ+5W), Uber H3 hexagons, Google S2 cells, map tile coordinates (14/2621/6331), WKT points, or pasted Google Maps / OpenStreetMap URLs.
texspace understands all of these formats automatically inside search() and autocomplete() — and exposes two zero-network helpers (parseDirect() and encodeSpatial()) so you can parse and convert between every spatial notation instantaneously in the browser or server.
Supported Input Formats#
| Format | Example Input |
|---|---|
| Decimal coordinates | 37.72047, -122.43765 |
| Degrees-Minutes-Seconds (DMS / DDM) | 37°46'29.6"N 122°25'09.8"W |
| Open Location Code (Plus Code) | 849VQHFQ+5W |
| Uber H3 Hex Index | h3:89283082a73ffff |
| Google S2 Cell Token | s2:8085808c |
Slippy Map Tile (z/x/y) | 14/2621/6331 |
| Bing Quadkey | qk:023010203330 |
| Geohash | gh:9q8yyk8y |
| Well-Known Text (WKT) | POINT(-0.1274 51.5033) |
geo: URI | geo:37.7749,-122.4194 |
| Map URLs | OpenStreetMap & Google Maps coordinate links |
Converting in JavaScript / TypeScript (Zero Network)#
You don't even need to open an archive to use Texspace.parseDirect() or Texspace.encodeSpatial():
import { Texspace } from "texspace";
// Parse any direct spatial string into { lat, lon, kind, label, bbox?, polygon?, zoom? }
const loc = await Texspace.parseDirect("849VQHFQ+5W");
console.log(loc); // { lat: 37.5729375, lon: -122.4101875, kind: "plus_code", ... }
// Encode any (lat, lon) into every grid notation at once
const cells = await Texspace.encodeSpatial(37.72047, -122.43765);
console.log({
h3: cells.h3_r9, // "89283082a73ffff"
s2: cells.s2_l13, // S2 level-13 token
geohash: cells.geohash_8, // "9q8yv1..."
plusCode: cells.plus_code, // "849VPHC6+5W"
tileZ14: cells.tile_z14, // "14/2620/6334"
dms: cells.dms,
wkt: cells.wkt, // "POINT(-122.43765 37.72047)"
});Paste decimal coordinates, DMS, Plus Codes, H3, S2, Geohash, slippy map tiles, WKT, or a map URL to decode and convert across every format in sub-millisecond local time.
// Decoded coordinates + S2 / H3 / Geohash / Plus Code / Tile / WKT output
Go Deeper#
- Territory & Data Enrichment — Pass
spatial: truetogeo.enrich()to include grid IDs alongside reverse address, timezone, and custom territories. - JavaScript & TypeScript SDK Reference — Complete
SpatialEncodingandDirectLocationfield list.