Skip to content

Commit 6f06930

Browse files
committed
Foursquare is already incorporated into Overture Maps; remove Foursquare code and documentation references.
1 parent 7b7e262 commit 6f06930

18 files changed

Lines changed: 29 additions & 974 deletions

File tree

.claude/CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Style: Black (format-on-save in VSCode). Lint: flake8 + pylint, configured in `p
2222

2323
## Architecture at a glance
2424

25-
**openpois** models POI stability over time from OpenStreetMap history, and produces unified OSM + Overture + Foursquare snapshots for web consumption. Work splits into four pipelines:
25+
**openpois** models POI stability over time from OpenStreetMap history, and produces unified OSM + Overture snapshots for web consumption. Work splits into four pipelines:
2626

2727
| Pipeline | Skill |
2828
|---|---|
2929
| Fit λ from OSM history, rate current snapshots | [skills/model-history-pipeline](skills/model-history-pipeline/SKILL.md) |
3030
| Iterate model variants on a pinned history run | [skills/iterate-model-types](skills/iterate-model-types/SKILL.md) |
31-
| Refresh the three POI snapshots (OSM / Overture / FSQ) | [skills/full-data-pull](skills/full-data-pull/SKILL.md) |
31+
| Refresh the POI snapshots (OSM / Overture) | [skills/full-data-pull](skills/full-data-pull/SKILL.md) |
3232
| Conflate OSM + Overture, partition, upload to S3 | [skills/conflate-snapshots](skills/conflate-snapshots/SKILL.md) |
3333
| Bump the frontend to the new data version | [skills/update-site](skills/update-site/SKILL.md) |
3434
| Post-run QA on any of the above | [skills/verify-pipeline-run](skills/verify-pipeline-run/SKILL.md) |
@@ -37,7 +37,7 @@ Style: Black (format-on-save in VSCode). Lint: flake8 + pylint, configured in `p
3737

3838
| Path | Purpose |
3939
|---|---|
40-
| [src/openpois/io/](../src/openpois/io/) | I/O adapters: OSM history/snapshot, Overture, Foursquare, Census boundary |
40+
| [src/openpois/io/](../src/openpois/io/) | I/O adapters: OSM history/snapshot, Overture, Census boundary |
4141
| [src/openpois/osm/](../src/openpois/osm/) | OSM-specific transforms: `format_observations`, `change_plots` |
4242
| [src/openpois/models/](../src/openpois/models/) | JAX/BlackJAX empirical Bayes: `ModelFitter`, model registry |
4343
| [src/openpois/conflation/](../src/openpois/conflation/) | OSM×Overture matching: `taxonomy`, `match`, `merge` |

.claude/docs/data-sources.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,9 @@ Reference for every external data source openpois ingests. For the workflow that
4444
- Geometry is native DuckDB GEOMETRY — must `LOAD spatial;` and use `ST_X()` / `ST_Y()`.
4545
- **Upcoming migration (~June 2026)**: L0/L1 hierarchy → flat `basic_category`. Crosswalk CSV + `assign_overture_shared_label` will need updating.
4646

47-
## Foursquare OS Places
48-
49-
**Used by**: current-state Foursquare snapshot (`foursquare_snapshot.parquet`).
50-
51-
- **Catalog**: `https://catalog.h3-hub.foursquare.com/iceberg` — PyIceberg `RestCatalog`.
52-
- **Auth**: `FSQ_PORTAL_TOKEN` env var.
53-
- **Params** (all in config.yaml):
54-
- `warehouse="places"` (required)
55-
- `namespace="datasets"`
56-
- `places_table="places_os"`, `categories_table="categories_os"`
57-
- **Pipeline**: row filter `country IN ('US', 'PR') AND date_closed IS NULL` → PyIceberg scan → sjoin against exact US+PR polygon (PyIceberg has no spatial predicates).
58-
- **Entry**: [src/openpois/io/foursquare.py](../../src/openpois/io/foursquare.py).
59-
- **Quirks**:
60-
- Table is **unpartitioned** (no `dt` column); release date inferred from `last_updated_at` in partition metadata.
61-
- `fsq_category_ids` arrives as numpy/pyarrow array — use `len(x) == 0`, **not** `if not x:`.
62-
- PR uses alpha-2 `'PR'`, not `'US'` — silent drop regression pre-2026-04-16 when filter was `'US'`-only.
63-
6447
## Census boundary
6548

66-
**Used by**: all three snapshot downloaders (spatial clipping).
49+
**Used by**: both snapshot downloaders (spatial clipping).
6750

6851
- **URL**: `download.general.boundary.source_url``https://www2.census.gov/geo/tiger/GENZ2023/shp/cb_2023_us_state_20m.zip` (1:20M cartographic, 50 states + DC + PR).
6952
- **Auth**: none.

.claude/docs/data-versioning.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ versions:
1010
model_output: "20260416_by_leisure" # fitted model artifacts (suffix indicates variant)
1111
snapshot_osm: "20260416" # OSM current-state snapshot
1212
snapshot_overture: "20260417" # Overture snapshot
13-
snapshot_foursquare: "20260416" # Foursquare snapshot
1413
aws: "20260416" # S3 prefix for uploaded data
1514
conflation: "20260417" # conflated output
1615
```
@@ -31,15 +30,15 @@ config.get_file_path("osm_data", "osm_versions")
3130

3231
**Prefer `get_file_path` over composing `get_dir_path()` + `get()` manually.**
3332

34-
`.get()` raises `ValueError` on null values — pass `fail_if_none=False` for optional fields like `download.overture.release_date: null` and `download.foursquare.release_date: null`.
33+
`.get()` raises `ValueError` on null values — pass `fail_if_none=False` for optional fields like `download.overture.release_date: null`.
3534

3635
`config.write_self(section)` snapshots the effective config into the output directory — used by model and conflation scripts to record the state of a run.
3736

3837
## Naming conventions
3938

4039
- **Dates**: `YYYYMMDD`, e.g., `20260416`.
4140
- **Model variants**: `{date}_by_{group_key}` (e.g., `20260416_by_leisure`, `20260416_by_amenity`) or `{date}_constant`. See [skills/iterate-model-types](../skills/iterate-model-types/SKILL.md).
42-
- **Independent cadences**: snapshot versions can (and should) differ across sources — Overture releases ~monthly, Foursquare separately. Don't force them to match.
41+
- **Independent cadences**: snapshot versions can (and should) differ across sources — Overture releases ~monthly. Don't force them to match.
4342

4443
## External references (hand-update when bumping)
4544

@@ -48,7 +47,7 @@ Version strings appear in these places outside `versions:` — grep before any c
4847
| File | References |
4948
|---|---|
5049
| [config.yaml](../../config.yaml) | `upload.latest_url_osm`, `upload.latest_url_conflation` (full URL with date) |
51-
| [site/src/constants.js](../../site/src/constants.js) | `OSM_S3_BASE`, `FSQ_S3_BASE`, `CONFLATED_S3_BASE` |
50+
| [site/src/constants.js](../../site/src/constants.js) | `OSM_S3_BASE`, `CONFLATED_S3_BASE` |
5251
| [site/public/about.html](../../site/public/about.html) | Hardcoded S3 browse links in the data-access section |
5352
| `osm_data.apply_model.model_stub` (config.yaml) | Which model family [scripts/osm_snapshot/apply_model.py](../../scripts/osm_snapshot/apply_model.py) ingests |
5453

.claude/skills/full-data-pull/SKILL.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
---
22
name: full-data-pull
3-
description: Use when the user wants to refresh the three independent POI snapshots (OSM, Overture, Foursquare) and rate the OSM snapshot for conflation. Triggers: "refresh all snapshots", "do a new data pull", "download new OSM/Overture/Foursquare", "monthly data refresh", "pull the latest POI data". Does NOT include conflation or S3 upload — those live in conflate-snapshots.
3+
description: Use when the user wants to refresh the independent POI snapshots (OSM, Overture) and rate the OSM snapshot for conflation. Triggers: "refresh all snapshots", "do a new data pull", "download new OSM/Overture", "monthly data refresh", "pull the latest POI data". Does NOT include conflation or S3 upload — those live in conflate-snapshots.
44
---
55

66
# Full data pull
77

8-
Downloads the three snapshot sources (50 US states + DC + PR) and applies the rating model to OSM so conflation can run.
8+
Downloads the snapshot sources (50 US states + DC + PR) and applies the rating model to OSM so conflation can run.
99

1010
## Prerequisites
1111

1212
- conda env `openpois` active.
13-
- For Foursquare: `FSQ_PORTAL_TOKEN` env var set.
1413
- For OSM: `osmium` in env bin (resolved automatically via `Path(sys.executable).parent / "osmium"`).
1514
- Boundary cache at `directories.boundary` (auto-downloads on first use).
1615
- A fitted model exists for the OSM rating step (see [skills/model-history-pipeline](../model-history-pipeline/SKILL.md)).
@@ -22,16 +21,14 @@ Downloads the three snapshot sources (50 US states + DC + PR) and applies the ra
2221
versions:
2322
snapshot_osm: "YYYYMMDD"
2423
snapshot_overture: "YYYYMMDD"
25-
snapshot_foursquare: "YYYYMMDD"
2624
```
2725
See [docs/data-versioning.md](../../docs/data-versioning.md).
2826
29-
2. **Run the three downloads** (independent — order doesn't matter, can run in parallel):
27+
2. **Run the downloads** (independent — order doesn't matter, can run in parallel):
3028
3129
```bash
3230
python scripts/osm_snapshot/download.py # ~11 GB US PBF + PR PBF → osm_snapshot.parquet
3331
python scripts/overture/download.py # DuckDB over S3 → overture_snapshot.parquet
34-
python scripts/foursquare/download.py # PyIceberg catalog → foursquare_snapshot.parquet
3532
```
3633
Per-source details, auth, and schema quirks are in [docs/data-sources.md](../../docs/data-sources.md).
3734

@@ -51,9 +48,8 @@ Downloads the three snapshot sources (50 US states + DC + PR) and applies the ra
5148
Hand off to [skills/verify-pipeline-run](../verify-pipeline-run/SKILL.md). Baseline totals (as of 2026-04-17):
5249
- OSM: ~7.78M POIs
5350
- Overture: ~13.05M POIs (jumped from ~7.23M after widening `download.overture.taxonomy_allowlist` to include `services_and_business` + `lifestyle_services` sub-branches)
54-
- Foursquare: ~8.32M POIs
5551

56-
Flag >5% drops — Foursquare in particular has had silent country-filter regressions (PR alpha-2 code quirk).
52+
Flag >5% drops.
5753

5854
## Next
5955

.claude/skills/update-site/SKILL.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Vue 3 + Vite frontend lives in [site/](../../../site/). After a data pull + uplo
99

1010
## Prerequisites
1111

12-
- New data published to S3 via [skills/conflate-snapshots](../conflate-snapshots/SKILL.md) (or the latest FSQ snapshot uploaded separately).
12+
- New data published to S3 via [skills/conflate-snapshots](../conflate-snapshots/SKILL.md).
1313
- Node + npm available (see `site/package.json` for engine requirements).
1414

1515
## Steps
@@ -18,7 +18,6 @@ Vue 3 + Vite frontend lives in [site/](../../../site/). After a data pull + uplo
1818

1919
2. **Update S3 URLs in [site/src/constants.js](../../../site/src/constants.js)** — each source may have a different date:
2020
- `OSM_S3_BASE``snapshots/osm/YYYYMMDD/osm_snapshot_partitioned`
21-
- `FSQ_S3_BASE``snapshots/foursquare/YYYYMMDD/foursquare_snapshot_partitioned`
2221
- `CONFLATED_S3_BASE``snapshots/conflated/YYYYMMDD/conflated_partitioned`
2322
- `OVERTURE_PMTILES_URL` → bump on monthly Overture release
2423

@@ -30,7 +29,7 @@ Vue 3 + Vite frontend lives in [site/](../../../site/). After a data pull + uplo
3029
```
3130
Verify:
3231
- Map loads POIs at zoom 14+ without CORS/404 errors
33-
- Source filter dropdown (OSM / Overture / Foursquare / Conflated) toggles data
32+
- Source filter dropdown (OSM / Overture / Conflated) toggles data
3433
- Taxonomy legend renders from `taxonomy.html`
3534
- POI popups show non-empty name/category/confidence
3635

.claude/skills/verify-pipeline-run/SKILL.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ description: Use when the user wants a QA/sanity check on a recently completed p
77

88
Post-run QA runbook. Pick the subsection that matches what just ran.
99

10-
## Snapshots (OSM / Overture / Foursquare)
10+
## Snapshots (OSM / Overture)
1111

1212
Baseline row counts (2026-04-17):
1313
- OSM: ~7.78M
1414
- Overture: ~13.05M (up from ~7.23M after widening `taxonomy_allowlist`; pre-2026-04-17 runs will be lower)
15-
- Foursquare: ~8.32M
1615

1716
Check:
1817
```python
@@ -21,7 +20,6 @@ pd.read_parquet(path).shape[0]
2120
```
2221

2322
Flag >5% drops. Known regression patterns:
24-
- **Foursquare**: PR alpha-2 code — filter must be `country IN ('US', 'PR')`, not `'US'` only.
2523
- **OSM**: PR is a *separate* PBF — confirm both `us-latest.osm.pbf` and `puerto-rico-latest.osm.pbf` got downloaded, filtered, and concat'd.
2624
- **Overture**: coarse-bbox pushdown + final DuckDB `ST_Within` — drop means the Aleutian antimeridian split was lost or the Census boundary failed to load. If the run crashed with "Information loss on integer cast", the DuckDB pin was bumped off 1.4.1 (see [docs/data-sources.md](../../docs/data-sources.md) → Overture Maps).
2725

@@ -63,7 +61,7 @@ Confirm `conf_mean`, `conf_lower`, `conf_upper` columns are populated for every
6361

6462
- Open the deployed site (or `npm run dev` locally after a constants.js bump).
6563
- Browser console: no CORS, no 404s on S3 URLs.
66-
- Filter dropdown: each source (OSM / Overture / Foursquare / Conflated) loads.
64+
- Filter dropdown: each source (OSM / Overture / Conflated) loads.
6765
- Popups non-empty; taxonomy legend rendered; PMTiles overlay visible at zoom 14+.
6866

6967
## Recording issues

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ make install_package # Install openpois in editable mode
1111

1212
## POI Snapshot Downloads
1313

14-
Three exploratory scripts download current US-wide POI snapshots from different sources. All output GeoParquet to `~/data/`.
14+
Two exploratory scripts download current US-wide POI snapshots from different sources. Both output GeoParquet to `~/data/`.
1515

1616
### OpenStreetMap
1717

@@ -31,18 +31,7 @@ Queries the public Overture Maps S3 bucket directly via DuckDB. No authenticatio
3131
python exploratory/overture/download.py
3232
```
3333

34-
Output: `~/data/openpois/snapshots/overture/<VERSION>/overture_snapshot.parquet` (~7.2M POIs)
35-
36-
### Foursquare OS Places
37-
38-
Queries the Foursquare Places Portal Apache Iceberg catalog. Requires a free API token from [places.foursquare.com](https://places.foursquare.com).
39-
40-
```bash
41-
export FSQ_PORTAL_TOKEN="<your_token>"
42-
python exploratory/foursquare/download.py
43-
```
44-
45-
Output: `~/data/openpois/snapshots/foursquare/<VERSION>/foursquare_snapshot.parquet` (~8.3M POIs)
34+
Output: `~/data/openpois/snapshots/overture/<VERSION>/overture_snapshot.parquet` (~13M POIs)
4635

4736
### Configuration
4837

config.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ versions:
44
model_output: "20260422_by_shared_label"
55
snapshot_osm: "20260417"
66
snapshot_overture: "20260423"
7-
snapshot_foursquare: "20260416"
87
aws: "20260423"
98
conflation: "20260423"
109

@@ -103,20 +102,6 @@ download:
103102
- [community_and_government, public_safety_service]
104103
- [travel_and_transportation, fueling_station]
105104
- [travel_and_transportation, vehicle_service]
106-
foursquare:
107-
release_date: null # null = auto-detect latest
108-
catalog_uri: "https://catalog.h3-hub.foursquare.com/iceberg"
109-
catalog_warehouse: "places"
110-
catalog_namespace: "datasets"
111-
places_table: "places_os"
112-
categories_table: "categories_os"
113-
token_env_var: "FSQ_PORTAL_TOKEN"
114-
l1_category_names:
115-
- "Dining and Drinking"
116-
- "Retail"
117-
- "Arts and Entertainment"
118-
- "Sports and Recreation"
119-
- "Health and Medicine"
120105

121106
# Settings for OSM exploratory data analysis
122107
osm_data:
@@ -185,12 +170,6 @@ directories:
185170
predictions: predictions.csv
186171
diagnostics: diagnostics.csv
187172
inference_data: inference_data.nc
188-
snapshot_foursquare:
189-
versioned: true
190-
path: ~/data/openpois/snapshots/foursquare
191-
files:
192-
snapshot: foursquare_snapshot.parquet
193-
partitioned: foursquare_snapshot_partitioned
194173
snapshot_osm:
195174
versioned: true
196175
path: ~/data/openpois/snapshots/osm
@@ -226,7 +205,6 @@ directories:
226205
files:
227206
osm_snippet: osm_snippet.csv
228207
overture_snippet: overture_snippet.csv
229-
foursquare_snippet: foursquare_snippet.csv
230208

231209
# Settings for POI conflation
232210
conflation:

docs/api.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,6 @@ from S3 if a specific date is not pinned.
9292
:undoc-members:
9393
:show-inheritance:
9494

95-
openpois.io.foursquare
96-
~~~~~~~~~~~~~~~~~~~~~~
97-
98-
Download a current US-wide Foursquare OS Places snapshot via the Foursquare
99-
Places Portal Apache Iceberg REST catalog. Authenticates with a portal token,
100-
loads US open venues filtered by L1 category, and resolves category names from
101-
the categories table. Requires the ``FSQ_PORTAL_TOKEN`` environment variable.
102-
103-
.. automodule:: openpois.io.foursquare
104-
:members:
105-
:undoc-members:
106-
:show-inheritance:
107-
10895
openpois.io.geohash_partition
10996
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11097

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ openpois
22
========
33

44
A Python library for conflating Points of Interest (POIs) across
5-
OpenStreetMap, Overture Maps, and Foursquare OS Places, with utilities for
6-
modeling POI stability over time using historical OSM data.
5+
OpenStreetMap and Overture Maps, with utilities for modeling POI
6+
stability over time using historical OSM data.
77

88
- **GitHub:** https://github.com/henryspatialanalysis/openpois
99
- **Web map:** https://openpois.org/

0 commit comments

Comments
 (0)