Skip to content

Feature: generate geojson layer from a FairData place model and add as a map layer #617

@jamiefolsom

Description

@jamiefolsom

Summary

Let an editor pick a FairData place model (e.g., one that is not indexed for search, like Marronage's "Colonial Landscape"), generate a geojson FeatureCollection from its records, save the file into the CDP site's static content, and register it as a map layer under layers[] in the site config — all without requiring the model to be added to Typesense.

Use case

Marronage has a "Colonial Landscape" Place model that's useful as a context layer on the Places explore map but isn't something users should filter/search on directly. Today the only ways to get place records on the map are (a) index them into Typesense for an Explore page, or (b) hand-author a geojson file. Both are heavy.

Proposed flow

  1. Add a "Generate layer" action to the CDP admin (or a CLI / rake task) that:
    • Takes a FairData project_id + project_model_id
    • Calls the FairData public API for places of that model
    • Emits a FeatureCollection (points, or polygons if the model has geometry_json)
    • Saves to content/layers/<slug>.geojson in the content repo (or to public/layers/ in CDP)
  2. Update TinaCMS schema for layers[] to accept a geojson type with a relative path
  3. At build time or runtime, fetch the geojson and render it as a non-interactive overlay on type: "map" searches

Example

Marronage "Colonial Landscape" places → content/layers/colonial-landscape.geojson → shown as a distinct-colored polygon/point layer beneath settlements and events.

Related

Notes

  • Could start as a standalone script in core-data-scripts that outputs geojson, then plumb the TinaCMS side later
  • Needs a decision on whether the geojson lives in the content repo (versioned, human-readable) or fetched on demand (cheaper, always fresh)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions