Add new /vessel/track endpoints.

This is a variation on /navdata but returns data more suitable
for plotting vessel tracks on the map.
This commit is contained in:
D. Berge
2025-08-10 21:39:35 +02:00
parent b9e0975d3d
commit acdf118a67
8 changed files with 241 additions and 1 deletions

View File

@@ -311,6 +311,30 @@ app.map({
get: [ mw.etag.noSave, mw.gis.navdata.get ]
}
},
'/vessel/track': {
get: [ /*mw.etag.noSave,*/ mw.vessel.track.get ], // JSON array
'/line': {
get: [ // GeoJSON Feature: type = LineString
//mw.etag.noSave,
(req, res, next) => { req.query.geojson = 'LineString'; next(); },
mw.vessel.track.get
]
},
'/point': {
get: [ // GeoJSON FeatureCollection: feature types = Point
//mw.etag.noSave,
(req, res, next) => { req.query.geojson = 'Point'; next(); },
mw.vessel.track.get
]
},
'/points': {
get: [ // JSON array of (Feature: type = Point)
mw.etag.noSave,
(req, res, next) => { req.query.geojson = true; next(); },
mw.vessel.track.get
],
},
},
'/info/': {
':path(*)': {
get: [ mw.auth.operations, mw.info.get ],