VHF channel information based on GeoJSON data. Plugin for SignalK included.
While sailing you're often expected to listen out certain VHF channels. Most of them can be found on the electronic maps, but not always in a handy way. And it requires you to know you have to look for it in advance.
By collection the VHF channel info together with coordinate information it's easy to display relevant information in the cockpit.
The information is collected as GeoJSON which holds both coordinates and properties.
- htool/vhfinfo (this repo): GeoJSON in
data/and the SignalK plugin. - htool/VHFinfoSite: vhfinfo.org (map, Nearby, editor).
See if certain VHF information is already present on the online map.
Open the online map, find the area, and press the pencil. Changing the map requires signing in (email link, no password). Site source and sign-in setup live in htool/VHFinfoSite.
Feature rows live in Supabase (supabase/README.md). The map reads that table, with this repo’s data/{CC}.json as fallback. Publishing writes the table; country files here are synced from it.
Goto one of the following country linke and draw the VHF channel area as a polygon. For different types there are different instructions for drawing:
Only draw the full locks chambers (typically rectangles). It's OK to cross over land for multiple chambers
Only draw under the bridge, fully from side to side (typically rectangles)
Free figure polygon that covers only the (land and water if that's simpler) marina
Here it is important to cover the documented coordinates of the VTS as close as possible, so likely a polygon. In case of half circles on sea towards a port, it's ok to make it less detailed to reduce points)
"properties": {
"name": "", // Full name
"callname": "", // Short name typically used in call
"type": "", // ['Lock','Bridge','Marina','VTS','VTS Radar support', 'Territorial']
"channel": , // VHF channel number
"update": "5 *", // Update bulletin (eg weather) in this VHF area in 'cron format'
"vhfdata": {
"generic": {
"mode": "listen" // Radio engagement level for this AIS ship/group type
// 'listen': Listen out the channel for any calls or information
// 'announce': Announce you are entering/leaving the area, or intend to pass bridge/lock
// 'report': More than announce, as certain info is expected. See 'note' for details
"url": "", // URL with generic info like opening hours, approach guide etc. or in case of non-generic purpose
"phone": "" // Phone number in E.164 formatting
}
"pleasure": { // AIS ship/group type as string. (https://coast.noaa.gov/data/marinecadastre/ais/VesselTypeCodes2018.pdf)
"url": "" // URL aimed at pleasure ships
},
"passenger": {
"note": "" // Note aimed at passenger ships
},
"fishing": {
"mode": "announce" // Overwrites mode for fishing ships
},
"cargo": {
"mode": "report",
"note": "", // Extra details on what to report
"url": "" // URL aimed at cargo ships
},
"emergency": {
"url": // Information for emergencies in this area
"phone": "" // Emergency phone number
}
}
}
}
Plugins can be create separate from this repository and just use VHFinfo as database. Listing them here could make them easier to find.
The plugin lets you configure the search 'beam' by specifying the length and angle as well as the SignalK path to write to. The plugin flow is as follows:
- Determine own location using
navigation.position - Draw a boundry box around the location with 100Nm (configurable) ribs
- Use countries_bbox.json to create bboxes and check if they intersect with the locationBox from step 2
- Read features from intersecting to see which intersect with locationBox from 2 and keep them in memory (featuresInBox)
- Use headingTrue, headingMagnetic, COG or bbox and location to create a searchPolygon 'beam' (or bbox) using the plugin config parameters
- Go through the features in featuresInBox and check if they intersect with searchPolygon
- Use result of 6 to calculate distance to each feature and sort by distance (negative distance means your located inside the feature)
- /plugin/vhfinfo/nearby can be called to pull the whole result set of 7.
- Write the nearest POI and VTS to the path configured in the plugin
SignalK App Store installs come from the npm package vhfinfo. A GitHub Action publishes a new patch version at most once per UTC day when country GeoJSON in data/ has changed since the last release (see .github/workflows/npm-publish-geojson.yml). Publishing uses npm trusted publishing (GitHub OIDC), so you do not need a rotating npm access token. Once, as package owner on npmjs.com: Package → Settings → Trusted Publisher → GitHub Actions, with organization htool, repository vhfinfo, workflow filename npm-publish-geojson.yml, and allowed action npm publish.
The resulting nearby VHF info objects array can be queried here:
/plugins/vhfinfo/nearby
You can configure where the plugin writes the two nearest Point of Interest (lock, bridge, marina) and VTS (Vessel Traffic Service). This can be used together with the SignalK Instrument Display Plugin to display current VHF info on any display.
