Repository navigation
Add Map API and map pages - #693
oliviasculley wants to merge 19 commits into
Conversation
781a3a6 to
705b52b
Compare
|
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? |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
Probably just a temporary Github bug, when I view the list of open PRs, it appears at the bottom (as the oldest open one) |
There was a problem hiding this comment.
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.
- 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.
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.
|
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>
|
@oliviasculley is there anything I can do to move this forward? I noticed this PR is sitting here for a while. |
|
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 |
|
Let me consult with AI if there's a better architecture that can be done |
- 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>
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.
df3653e to
55534c0
Compare
|
Rebased onto latest
The GeoJSON schema validation thread was already implemented earlier; marked it resolved. |
|
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). |
|
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 |
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.
No description provided.