Skip to content

Add Map API and map pages - #693

Draft
oliviasculley wants to merge 19 commits into
hackgvl:developfrom
oliviasculley:map-api
Draft

oliviasculley wants to merge 19 commits into
hackgvl:developfrom
oliviasculley:map-api

Conversation

@oliviasculley

Copy link
Copy Markdown
Member

No description provided.

@oliviasculley
oliviasculley force-pushed the map-api branch 3 times, most recently from 781a3a6 to 705b52b Compare March 20, 2026 05:27
@oliviasculley oliviasculley changed the title Add Map API Add Map API and map pages Mar 20, 2026
@oliviasculley
oliviasculley marked this pull request as ready for review March 20, 2026 05:29
@allella

allella commented Apr 28, 2026

Copy link
Copy Markdown
Member

This PR is still on the radar, but I did pull it up today and noticed it's not showing under open PRs, even though the list of PRs shows (3) and then only lists (2) PRs. Is there some mystery status on this PR?

@claude

claude Bot commented May 7, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@oliviasculley

Copy link
Copy Markdown
Member Author

Probably just a temporary Github bug, when I view the list of open PRs, it appears at the bottom (as the oldest open one)

@allella allella left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is far from a complete technical or practical review, but I wanted to finally get something for you to chew on after 4 months.

Thanks for the work on this PR. It's a step in the right direction for a nice UI and API for devs, and probably will see more AI agents use in the near term than we ever had directly from humans.

This will be a great help in decommission the old server in the near-term.

The BIGGER questions surround things pondered a couple of years ago that the primary HG domain and app likely don't need to address.

Maintaining Search / Human Traffic

  • We'll need to transition the human search engine or bookmark traffic without breaking the SEO or usability of the old map preview URLs that get the bulk of the traffic and practical use.
  • This requires maintaining clean, comparable URL on some domain or subdomain to which we can 301 redirect.
  • A quick and dirty implementation would be to 301 the old patterns like https://data.openupstate.org/map/preview/electric-vehicle-charging-stations to
    https://hackgvl.github.io/open-map-data-multi-layers-demo/?lat=34.844526&lng=-82.401078&zoom=10&maps=electric-vehicle-charging-stations,
    • The free hosting and low security concerns are nice, but there are many concerns with simply using the Demo page on a Github pages subdomain as an intermediate or long-term solution.
      • the long and variable URLs with a bunch of query strings create usability, duplicate content, and SEO problems
      • the use of a Github subdomain is not ideal for a lot of reasons
        • it's not trivial / ideal to 301 redirect away from Github pages if we started using the domain as the primary and wanted to change to another domain alter
        • poor SEO vs a custom domain or subdomain
        • confusing / disconnected branding under Github's domain
        • dependency on the whims of mega corp
      • Hosting the demo map, or some variant, on a dedicated domain would solve some, but not all of those concerns.

Pruning / Migrating Layers

  • The original map layer spreadsheets are still owned by a Google Workspace account from Code for the Carolinas old fiscal sponsor. That could be deactivated at any moment, so we also need to migrate the spreadsheets we're keeping to HackGreenville's shared Google Drive. I moved coworking and breweries over in the past, so there's already an established pattern for that.
  • We increasingly have stale or hardly used map layers beyond what we had in mid-2024 when I checked which layers were actually getting traffic.
  • The iMAP project between Prisma / Furman / Greenville County seems to be be dead. The ArcGIS links (ex. for Recycling) and the iMAP application no longer work .
  • We have dozens of basically unsupported County / iMap layers with no maintainers or spreadsheet.
    • Many / most of them are low / no traffic and/or not something that's aligned enough to be showing directly under the HG domain.
    • We could do a campaign to find new maintainers a consider some layers with no maintainer interest for the scrap heap
    • Some of the data we have for the Swamp Rabbit Trail is coming through OpenStreetMaps and/or Mike Nice. It would be good to better sync things between our spreadsheets and what's contributed back to OpenStreetMaps as part of their tile data.
  • The Swamp Rabbit Trail main path layer is currently wrong. It's showing the same path data as the Spurs and Connectors. We'll need to fix that.
  • We should still talk with Bennett and the Bike Walk Greenville folks to coordinate all the things related the layers, API, and storing the syndicated or original data.

Separation of Concerns

  • It was convenient to have a dedicated data domain, separate from HG and Code For Greenville, as the catch all for human traffic and developers alike. Though, it was never a well polished publish facing site or a well used developer site.
  • Publicizing the technical stuff fits the hackgreenville.com domain, given HG Labs manages the project. However, I don't see that we'd want to cram 50 random and/or stale map layers into the SEO and structure of the primary HG domain.

Comment thread app-modules/api/src/Http/Controllers/EventApiV1Controller.php Outdated
Comment thread app-modules/api/src/Http/Controllers/MapLayersApiV1Controller.php Outdated
Comment thread app-modules/api/src/Resources/MapLayers/V1/MapLayerResource.php Outdated
Comment thread app/Filament/Resources/MapLayerResource/Pages/ListMapLayers.php
Comment thread app/Services/MapLayerSyncService.php
Comment thread app/Services/MapLayerSyncService.php Outdated
@oliviasculley

oliviasculley commented Jul 31, 2026 •

Copy link
Copy Markdown
Member Author

Thanks for the thorough review, @allella! I first brought the branch up to date with the latest develop (resolved the nav/CSS conflicts from the design-system merge), then pushed ccd38ef addressing the inline code feedback:

  • Reusable LIKE macro — extracted the wildcard-escaping into a whereLikeContains() Eloquent Builder macro, now shared by the Events and Map Layers API controllers.
  • Slug lookups — added an exact-match slug filter to the Map Layers API for clean 1-to-1 queries alongside the fuzzy title search.
  • geojson_link vs geojson_url — documented the remote-source vs HG-hosted distinction in the Filament form and the API docs.
  • Sync hardening — JSON_THROW_ON_ERROR on encode, stricter GeoJSON structure validation, and skipping CSV rows with out-of-range coordinates. Added tests for each.

Replied inline on each thread with specifics.

On the bigger-picture items (301-redirecting the old data.openupstate.org preview URLs and SEO, migrating the layer spreadsheets off the old fiscal-sponsor Workspace, pruning stale County/iMAP layers, the Swamp Rabbit Trail path fix, and the separation-of-concerns question of what belongs under the primary HG domain) — I agree these are important but they're each their own effort beyond this PR, which is focused on standing up the Map API + pages so we can start decommissioning the old server. I'd suggest we capture them as tracking issues so they don't get lost. Happy to open those if you'd like.

Comment thread app/Console/Commands/SyncMapLayersCommand.php
Comment thread storage/app/geojson/art-galleries.geojson Outdated
Comment thread app/Services/MapLayerSyncService.php Outdated
oliviasculley added a commit to oliviasculley/hackgreenville-com that referenced this pull request Aug 1, 2026
Replace the lightweight `type === FeatureCollection` / features-array checks
in MapLayerSyncService with true structural validation using
swaggest/json-schema and a bundled, self-contained RFC 7946 GeoJSON schema
(all internal $refs, so validation never touches the network).

- Decode remote GeoJSON to objects so empty JSON objects (e.g. `properties: {}`)
  survive instead of collapsing to `[]` and breaking both validation and the
  stored file.
- Build CSV-derived GeoJSON as objects for the same reason.
- Cache the compiled schema per process.
- Add tests for malformed geometry rejection and empty-properties round-trip.

Addresses PR hackgvl#693 review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bogdankharchenko

Copy link
Copy Markdown
Collaborator

@oliviasculley is there anything I can do to move this forward? I noticed this PR is sitting here for a while.

@oliviasculley

Copy link
Copy Markdown
Member Author

I'll rebase the ticket to fix the merge conflicts, but I think it's a matter more of agreement to get this merged than code

@oliviasculley

Copy link
Copy Markdown
Member Author

Let me consult with AI if there's a better architecture that can be done

@oliviasculley
oliviasculley marked this pull request as draft September 11, 2026 13:47
oliviasculley and others added 9 commits September 11, 2026 13:48
- Extract the LIKE-wildcard escaping into a reusable `whereLikeContains`
  Eloquent Builder macro and use it across the Events and Map Layers API
  controllers (removes duplicated escape logic).
- Add an exact-match `slug` filter to the Map Layers API for 1-to-1 lookups
  alongside the existing partial `title` search.
- Clarify the geojson_link (remote source) vs geojson_url (HG-hosted) split
  via Filament helper text and Scribe @responseField docs.
- Harden MapLayerSyncService: encode with JSON_THROW_ON_ERROR, validate the
  GeoJSON features array, and skip CSV rows with out-of-range coordinates.
- Regenerate API docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
oliviasculley and others added 3 commits September 11, 2026 13:48
Replace the lightweight `type === FeatureCollection` / features-array checks
in MapLayerSyncService with true structural validation using
swaggest/json-schema and a bundled, self-contained RFC 7946 GeoJSON schema
(all internal $refs, so validation never touches the network).

- Decode remote GeoJSON to objects so empty JSON objects (e.g. `properties: {}`)
  survive instead of collapsing to `[]` and breaking both validation and the
  stored file.
- Build CSV-derived GeoJSON as objects for the same reason.
- Cache the compiled schema per process.
- Add tests for malformed geometry rejection and empty-properties round-trip.

Addresses PR hackgvl#693 review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename geojson_link/geojson_url to geojson_remote_link/geojson_local_url
so the remote origin vs HG-hosted file split is obvious in code and the API.

Add map:sync --delay for throttling bulk syncs, and pause 1s between
layers on Filament Sync All.

Stop tracking synced GeoJSON in git. The files stay on disk and are
ignored via storage/app/geojson/.gitignore.
@oliviasculley

Copy link
Copy Markdown
Member Author

Rebased onto latest develop and addressed the remaining review threads in 55534c0:

  • Renamed geojson_link / geojson_url → geojson_remote_link / geojson_local_url
  • Added map:sync --delay= and a 1s pause on Filament Sync All
  • Stopped tracking synced GeoJSON in git (files remain on disk, ignored locally)

The GeoJSON schema validation thread was already implemented earlier; marked it resolved.

@oliviasculley
oliviasculley marked this pull request as ready for review September 11, 2026 14:17
@allella

allella commented Sep 15, 2026

Copy link
Copy Markdown
Member

I'm still of the mind that we should get folks together and come up with a migration and pruning plan for the data.

If we set this live on the HG site without migrating things, we'll end up messing up the SEO and such, as noted above, we've built up over the years, continuing to support stall layers that we might be able to prune, or having duplicate resources on the web until we do some proper redirects and such.

@oliviasculley would you be free in the coming weeks for a face to face? I think at least you, me, Mike Nice, Bennett Meares would be good, and perhaps an HG committee member (Pam or Bogdan).

@oliviasculley

Copy link
Copy Markdown
Member Author

having the query parameters I think is best practice since it lets the urls be bookmarkable, and is tolerant for page refreshes etc. I would like to move/bundle the map to render on a proper url instead of the github url, but it's mainly been administrative issues I think that has stopped that. I'm not really that interested in working through the issues to get this mergeable, I mostly just wanted to push this up and get the conversation started so I can do the implementation work to get it to an acceptable solution, but I'm okay with this not getting merged until then

oliviasculley and others added 2 commits October 14, 2026 17:54
Keep the map layer query macro and develop's Scribe base URL callback.
Point the map layer code samples at config("app.url") like the other endpoints.
@oliviasculley
oliviasculley marked this pull request as draft October 15, 2026 19:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants