{
  "docVersion": 1,
  "id": "blog-gis-3",
  "name": "geometry vs geography — flat vs round earth",
  "purpose": "geometry treats coordinates as points on a flat plane (fast, but wrong over long distances); geography does the math on a sphere (accurate meters).",
  "nodes": {
    "p1": {
      "type": "geo",
      "label": "geometry(Point)",
      "x": 60,
      "y": 120,
      "w": 160,
      "h": 86,
      "color": "amber",
      "runtime": "planar · Cartesian"
    },
    "p2": {
      "type": "geo",
      "label": "geography(Point)",
      "x": 60,
      "y": 340,
      "w": 160,
      "h": 86,
      "color": "green",
      "runtime": "spherical · WGS84"
    },
    "d1": {
      "type": "database",
      "label": "distance = √(Δx²+Δy²)",
      "x": 400,
      "y": 120,
      "w": 200,
      "h": 86,
      "runtime": "in SRS units — degrees!"
    },
    "d2": {
      "type": "database",
      "label": "distance on the sphere",
      "x": 400,
      "y": 340,
      "w": 200,
      "h": 86,
      "runtime": "in real METERS"
    },
    "use1": {
      "type": "search",
      "label": "same-city, planar-projected data",
      "x": 760,
      "y": 120,
      "w": 210,
      "h": 86,
      "color": "amber",
      "runtime": "fast · fine for small areas"
    },
    "use2": {
      "type": "search",
      "label": "GPS lat/lon, any distance",
      "x": 760,
      "y": 340,
      "w": 210,
      "h": 86,
      "color": "green",
      "runtime": "correct across the globe"
    }
  },
  "edges": {
    "e1": {
      "from": "p1",
      "to": "d1",
      "fromSide": "right",
      "toSide": "left"
    },
    "e2": {
      "from": "d1",
      "to": "use1",
      "fromSide": "right",
      "toSide": "left"
    },
    "e3": {
      "from": "p2",
      "to": "d2",
      "fromSide": "right",
      "toSide": "left"
    },
    "e4": {
      "from": "d2",
      "to": "use2",
      "fromSide": "right",
      "toSide": "left"
    }
  },
  "boxes": {
    "z1": {
      "x": 30,
      "y": 60,
      "w": 950,
      "h": 190,
      "label": "GEOMETRY — flat plane",
      "color": "amber",
      "opacity": 0.04
    },
    "z2": {
      "x": 30,
      "y": 280,
      "w": 950,
      "h": 190,
      "label": "GEOGRAPHY — round earth",
      "color": "green",
      "opacity": 0.04
    }
  },
  "texts": {
    "t1": {
      "x": 30,
      "y": 500,
      "text": "rule of thumb: raw GPS coordinates → use geography (meters, correct everywhere).\ngeometry is faster and fine when your data is already projected to a flat local grid — but its 'distance'\nbetween two lat/lon points is measured in DEGREES, which is nonsense for 'within 3 km'.",
      "color": "gray",
      "size": 12
    }
  },
  "meta": {
    "createdAt": "2026-07-21T09:00:00.000Z",
    "modifiedAt": "2026-07-21T09:00:00.000Z"
  }
}