Skip to content

Add {bbox} and {bbox_3857} URL substitution for WMS proxy support#54

Open
catapulta wants to merge 1 commit intoSignalK:masterfrom
catapulta:feat/bbox-proxy-support
Open

Add {bbox} and {bbox_3857} URL substitution for WMS proxy support#54
catapulta wants to merge 1 commit intoSignalK:masterfrom
catapulta:feat/bbox-proxy-support

Conversation

@catapulta
Copy link

Summary

Adds {bbox} and {bbox_3857} URL substitution to the tile proxy so WMS chart sources can be proxied and cached alongside regular tile sources.

NOAA retired their RNC tile service and the Chart Display Service now serves S-57 ENC data through WMS only — no XYZ tile endpoint. This makes caching impossible with the current proxy since it only does {z}/{x}/{y} substitution.

Addresses #53

What changed

  • {bbox} replaced with minLon,minLat,maxLon,maxLat (EPSG:4326)
  • {bbox_3857} replaced with the same bounds in Web Mercator
  • tileToBBox promoted from private to static (already existed, just needed to be callable from the static fetchTileFromRemote)
  • Small lonLatToMercator helper for the 3857 projection

No changes to config schema, proxy routes, or caching/seeding — those already work on tiles internally. Fully backwards compatible: the bbox logic only fires if the URL contains {bbox} or {bbox_3857}, existing configs are untouched.

Example: NOAA S-57 ENC with caching

Field Value
Server type tilelayer
Format png
Proxy enabled
URL https://gis.charttools.noaa.gov/arcgis/rest/services/MCS/NOAAChartDisplay/MapServer/exts/MaritimeChartService/WMSServer?service=WMS&version=1.3.0&request=GetMap&layers=0,1,2,3,4,5,6,7,8,9,10,11,12&styles=&crs=EPSG:3857&bbox={bbox_3857}&width=256&height=256&format=image/png&transparent=true

Testing

  • Tested on Raspberry Pi 4 running OpenPlotter / SignalK 2.19.1 with Freeboard-SK
  • NOAA ENC tiles fetch, cache to disk, and serve from cache on subsequent requests
  • Existing {z}/{x}/{y} tile sources continue to work unchanged

Allows WMS chart sources to be proxied and cached by converting
tile coordinates to bounding box parameters in the remote URL.
This enables caching for services like the NOAA Chart Display
Service (S-57 ENC) that only offer WMS endpoints.
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.

1 participant