-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whale sightings data in Signal K #1784
Comments
How are you sending this? |
Through a file stream with the data type as SignalK |
It should be one delta per line (not an array), no new lines in the deltas Also, your "context" is not right, you probably want it to be "vessels.self" ?
|
NDJSON format right? When i try to save that to a JSON file it gives me errors. |
the whole file is not really valid json since it's one json per line |
what should the file type be? |
It's just text. Extension does not matter. |
I think you are now playing the same datafile over and over again, as fast as the server can process (6000+ messages per second). What are you actually trying to achieve? Where is your data coming from? |
I am working on a project to visualize whale sightings from a JSON data source on a map. Currently, I have a Python script that generates a static JSON file with whale sighting data. My immediate goal is to display this data on a map and ensure the visualization correctly represents the sightings. As a next step, I plan to periodically update the JSON file at regular intervals and reflect these updates on the map automatically. Eventually, I aim to overlay this whale sighting data with an AIS viewer to analyze vessel interactions with the whales, but this is a future development phase. At the moment, I am seeking guidance on how to get started with displaying the static JSON data on a map and understanding how I can have the map stay up-to-date when I run my python script to update the JSON file. |
Given your description of what you are trying to achieve it aligns with the concept of You can use the built-in Resources provider plugin configuration to define a path for your resource files (in your case, Whale Sighting entries) which will then be available to client apps such as Freeboard-SK for display. |
Adrian has a point. Is this more static in nature, like POIs (points of interest with location) or dynamic (like AIS data: "here's a vessel at this point")? |
The map is dynamic in that it updates to display new sightings as they are submitted by the community. However, the sightings themselves are more static compared to something like AIS data, since vessel positions are constantly updating but the sightings aren't. In other words, the sightings are static and don't move on the map but newly submitted sightings should be displayed on the map as they roll in. So the map is dynamic but the sightings are static? If that makes sense. |
@panaaj following your instructions, would I then save the data file into signalk/v2/api/resources/whales? Will it then automatically display the data to the freeboard-SK? I appreciate everyone's help, I am new to all of this |
is there a sample JSON i could use when testing the resource plug-in? im messing with it and im wondering if my file is the issue |
For testing the resource plugin, you can keep it simple and start with the You can post this schema to the Note: If you use the Example: Create a new sighting location by sending a POST request with the following payload:
Deltas are sent when resources are created, updated or deleted using the API. |
Ok, i got that to display! I feel close to solving this issue. signalkSightings_JSON.json |
How do you want to show multiple sightings? I will assume one location and some kind of label indicating the number of sightings. The easiest way to do that without any code updates is to use a waypoint and set the name to be the number of sightings in that location. Currently the waypoint icon does not change based on the |
I will have a look at these when I get back to land... Won't be for a few days though. |
I want to show multiple sightings as multiple points on the map, such as one near Seattle, Bainbridge Islands, and one near Edmonds in Washington state. Not necessarily how many whales were spotted in a pod- in that case, I would display it in the description or title as you said. My data pull retrieves whale sightings throughout the west coast of Washington state, and I want to display all those sightings along the coast. I'll attach an example of my previous project that did this. Eventually, I'd like to implement transparency to show time passed and also the connecting lines between sightings, but I feel as though that's a project development further into the future so no need to worry about that right now. No rush responding! I'll be out of the office all of next week, so I won't be active again until 09/23. |
@puzzledcherry So close.....
Example: data.json {
"name": "Whale Sighting #1",
"description": "Whale sighting from shore.",
"type": "whale",
"feature": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
4.964859905436475,
53.38410865639514
]
},
"properties": {}
}
}
|
@panaaj Thank you so much! Your instructions were clear, and I was able to successfully replicate the results. I also love the addition of the "whale" waypoint type – it's exactly what I need! Could you please guide me/point me in the direction of some resources on how to display hover information for these points? Each sighting includes some details I'd like to show when users hover over them. |
So "hover information" I am going to assume refers to information displayed by the client. The waypoint resource schema contains a Ultimately the behaviour will be determined by the client, so for example, currently Freeboard-SK will:
For an example of how Freeboard-SK could display feature properties for waypoints, click on an AIS target and then click |
I'm running into errors with having the signalK server parse my JSON file. I've attached a screenshot of the server log and the JSON file. I can't seem to find the issue as to why it's not parsing.
signalkSightings.json
The text was updated successfully, but these errors were encountered: