Guide · Coordinates & GIS Helpers

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#

FormatExample Input
Decimal coordinates37.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 Indexh3:89283082a73ffff
Google S2 Cell Tokens2:8085808c
Slippy Map Tile (z/x/y)14/2621/6331
Bing Quadkeyqk:023010203330
Geohashgh:9q8yyk8y
Well-Known Text (WKT)POINT(-0.1274 51.5033)
geo: URIgeo:37.7749,-122.4194
Map URLsOpenStreetMap & 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():

ts
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)"
});
Try It Live: Zero-Network Coordinate & Spatial Grid Converter
0 NETWORK REQUESTS · PURE WASM

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.

Ready — runs completely offline in your browser.
// Decoded coordinates + S2 / H3 / Geohash / Plus Code / Tile / WKT output

Go Deeper#