# Geo Cluster

Cluster latitude and longitude points by real ground distance with DBSCAN or a grid. Get cluster assignments and centroids, entirely in your browser.

## Run it

- **CLI:** `gizza tool geo-cluster "51.5074,-0.1278,Charing Cross
51.5079,-0.1281,Nelson's Column
51.5155,-0.1410,Oxford Circus
51.5161,-0.1415,Regent Street
40.7128,-74.0060,New York"`
- **Web:** https://gizza.ai/tools/geo-cluster/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/geo-cluster/tool.json

## Inputs

- `points` — Points _(field)_
- `method` — Method _(field)_
- `radius` — Radius / cell size _(field)_
- `units` — Units _(field)_
- `min_points` — Minimum points per cluster _(field)_
- `coord_order` — Coordinate order _(field)_
- `output` — Output format _(field)_

## Output

- Clusters (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `points` — Points
- `method` — Method
- `radius` — Radius / cell size
- `units` — Units
- `min_points` — Minimum points per cluster
- `coord_order` — Coordinate order
- `output` — Output format

Example: `https://gizza.ai/tools/geo-cluster/?points=51.5074%2C-0.1278%2CCharing%20Cross%0A51.5079%2C-0.1281%2CNelson%27s%20Column%0A51.5155%2C-0.1410%2COxford%20Circus%0A51.5161%2C-0.1415%2CRegent%20Street%0A40.7128%2C-74.0060%2CNew%20York&method=dbscan&radius=500&units=m&min_points=2&coord_order=lat_lon&output=text`

---

Paste latitude/longitude points and choose DBSCAN or grid clustering to group nearby locations by real ground distance. The tool accepts CSV/TSV rows, JSON arrays, or GeoJSON, then returns cluster assignments and spherical centroids without sending data anywhere.

Example input:

```text
51.5074,-0.1278,Charing Cross
51.5079,-0.1281,Nelson's Column
51.5071,-0.1274,Strand
51.5155,-0.1410,Oxford Circus
51.5161,-0.1415,Regent Street
40.7128,-74.0060,New York
```

With `method=dbscan`, `radius=200`, `units=m`, and `min_points=2`, the London points split into nearby clusters and the New York point is reported as unclustered noise. Switch `output` to CSV for spreadsheet joins, JSON for full metadata, or GeoJSON for map layers.

DBSCAN is best when clusters can have irregular shapes and outliers should stay unclustered. Grid mode is deterministic and fast for rough tiling: each latitude-compensated cell becomes a cluster when it holds enough points.

Limits: up to 10,000 points, latitude must be -90..90, longitude -180..180, and radius must be positive. CSV headers, blank lines, and `#` comments are ignored. GeoJSON coordinates always use longitude, latitude order; `coord_order` only affects CSV rows and JSON numeric pairs.

<details>
<summary>When should I use DBSCAN instead of grid?</summary>

Use DBSCAN when "nearby" means points can chain together into natural shapes, such as store visits around a neighbourhood or GPS pings along a route. Use grid when you need reproducible buckets of a fixed size and do not want clusters to cross cell boundaries.
</details>

<details>
<summary>What radius should I choose?</summary>

Pick the distance at which two points should count as the same place. For store visits or venue dedupe, try 50-200 m. For city districts, try 1-5 km. The radius is a real ground distance computed with haversine math, not a raw degree threshold.
</details>

<details>
<summary>Why are some points marked as noise?</summary>

In DBSCAN, a point is noise when it is not within `radius` of a core point. A core point needs at least `min_points` neighbours including itself. Lower `min_points`, increase `radius`, or choose grid mode if every point must receive a bucket.
</details>

<details>
<summary>Can I put the result on a map?</summary>

Yes. Set `output=geojson` to get a FeatureCollection containing the original points tagged with cluster ids plus centroid features for each cluster. Paste that output into a GeoJSON viewer or GIS tool.
</details>

## Related tools

- [Absolute value, sign, or negation for a whole column](https://gizza.ai/tools/absolute-value-transformer/): Paste a column of numbers and apply absolute value, sign extraction (-1/0/1), sign flipping, or force-negative to every value at once, with rounding and an audit table.
- [Adjacency Matrix Converter](https://gizza.ai/tools/adjacency-matrix-converter/): Convert a graph between edge list, adjacency matrix, and incidence matrix — directed or undirected, weighted or not. Free, private, runs in your browser.
- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
- [ARFF Converter](https://gizza.ai/tools/arff-converter/): Convert Weka ARFF datasets to CSV and CSV tables back to ARFF locally — nominal attributes, numeric types, dates, sparse rows, missing values, and type rows.
- [Avro to JSON Converter](https://gizza.ai/tools/avro-to-json/): Decode Apache Avro Object Container Files (.avro / OCF) to JSON, NDJSON, or the embedded schema — no .avsc needed, free and private in your browser.
