/vessels/<RegExp>/navigation/state path

Subj doc does not have a list of possible values. And it's values is an arbitrary text, not a AIS spec phrases nor codes. Is there a complete list of these values somewhere?
7 Replies
Владимир Калачихин
Thanks. But why not the digital code directly from the AIS specification?
Teppo Kurki
Teppo Kurki3mo ago
i don't think we've captured the original reasoning, but - codes are non-extensible: can't easily add more possible values if all you have is a bunch of magic numbers specified by someone else - human readability of the raw data: navigation.state:motoring vs s:22
Владимир Калачихин
Heh. Not all humans want to read English. The available software understands the standard codes, so adaptation is needed. That's how it looks from my side. But ok, I've adapted it.
Roger
Roger3mo ago
That’s what enums are for.
Teppo Kurki
Teppo Kurki3mo ago
an enum could be used to document the well known values (the ones in the links above). the problem with making the values an enum is that it implies that no other values would be allowed - people would generate code that would not pass any other values. this is a part of what i meant by extensibility or lack thereof naturally if I start using navigation.state value liukuu you would not be able to make much sense of it, but the system would still pass it and a db plugin would happily store it (at least my influxdb plugin would 😉 the SK data model is english, so having the values in english is in line with that. but you are right about the lack of systematic internationalisation/translation support in SK in general. but we are open to contributions!!
Владимир Калачихин
Can be added to the meta/properties/{name} something like internationalization key. For example:
"position":{
"meta":{
"description":"The position of the vessel in 2 or 3 dimensions (WGS84 datum)",
"properties":{
"longitude":{
"type":"number",
"description":"Longitude",
"units":"deg",
"example":4.98765245
"internationalization":{
"ru": {
"description":"Долгота",
"units":"°",
}
}
},
"latitude":{
"type":"number",
"description":"Latitude",
"units":"deg",
"example":52.0987654
"internationalization":{
"ru": {
"description":"Широта",
"units":"°",
}
}
},
"altitude":{
"type":"number",
"description":"Altitude",
"units":"m"
"internationalization":{
"ru": {
"description":"Высота",
"units":"м.",
}
}
}
},
},
"value":{
"longitude":5.71,
"latitude":52.84108333333333
},
"$source":"naiveNMEAdaemon.GP",
"timestamp":"2024-03-28T20:09:39.000Z",
"sentence":"RMC"
}
"position":{
"meta":{
"description":"The position of the vessel in 2 or 3 dimensions (WGS84 datum)",
"properties":{
"longitude":{
"type":"number",
"description":"Longitude",
"units":"deg",
"example":4.98765245
"internationalization":{
"ru": {
"description":"Долгота",
"units":"°",
}
}
},
"latitude":{
"type":"number",
"description":"Latitude",
"units":"deg",
"example":52.0987654
"internationalization":{
"ru": {
"description":"Широта",
"units":"°",
}
}
},
"altitude":{
"type":"number",
"description":"Altitude",
"units":"m"
"internationalization":{
"ru": {
"description":"Высота",
"units":"м.",
}
}
}
},
},
"value":{
"longitude":5.71,
"latitude":52.84108333333333
},
"$source":"naiveNMEAdaemon.GP",
"timestamp":"2024-03-28T20:09:39.000Z",
"sentence":"RMC"
}