TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.18k stars 362 forks source link

Add Model For Socket.IO To Support Real-Time Position Animation #908

Open metanomy opened 9 years ago

metanomy commented 9 years ago
  1. Add a Model (https://github.com/TerriaJS/terriajs/tree/master/lib/Models):
    • Protocol: socket.io
    • Data Model: standard JSON field names for automatic lat/lon/altitude CZML conversion (any other property names are made available in the data view if the object is selected)
    • Options: define namespace/room(s), default icon or gltf model.
  2. Add any necessary dependencies (node, etc.) to the Docker build script.
meh9 commented 9 years ago

This would be so cool!

axman6 commented 9 years ago

We're interested in something that may be similar, to support live CZML data in a nice way. Feature I'd want are the ability to specify an initial URL for the whole CZML, and a second one with a refresh rate to get updates. I know CZML already supports this but it seems to need some JS to be written - we'd like to specify it in the init.json.

metanomy commented 9 years ago

@axman6 Isn't there already a TerriaJS model for CZML? If so, we'd just need to define an option for refresh rate.

And just in case you didn't notice it, we've funded a bounty for this request: https://www.bountysource.com/issues/26592951-add-model-for-socket-io-to-support-real-time-position-animation

vegetableman commented 8 years ago

@metanomy is this bounty still available? . Would love to work on this issue.

metanomy commented 8 years ago

Yes, there is a $500 bounty for this. And we'd love for you to work on this issue :)

moomou commented 8 years ago

@vegetableman Did you start on this? Was thinking of giving this a try if you are not planning to do it.

vegetableman commented 8 years ago

Haven't started yet and won't be working on it any time soon. Go ahead.

On Mon, Jan 18, 2016 at 4:44 AM, paul notifications@github.com wrote:

@vegetableman https://github.com/vegetableman Did you start on this? Was thinking of giving this a try if you are not planning to do it.

— Reply to this email directly or view it on GitHub https://github.com/TerriaJS/terriajs/issues/908#issuecomment-172394438.

Fohlen commented 8 years ago

Is this still being worked on? Looked over it and it should be doable in a reasonable amount of time with Socket.io/1.0

metanomy commented 8 years ago

@Fohlen Nope. Seems the others got started and didn't finish for some reason. Please feel free to take it on. Bounty is still active.

metanomy commented 8 years ago

Terria works well for historical data - even time-series data. Allowing for (near) real-time data would dramatically increase the value proposition for different industries (emergency/environmental response, sports, etc).

Imagine being able to see the 3D position of all airplanes (via ADS-B) and/or ships (via AIS) at the same time. Or allow multiple small drone operators to self-manage their local airspace. Or - in our case - allow us to manage large groups of people doing trash cleanup along the beaches in Tampa Bay.

glf256 commented 8 years ago

Is there an example of a live data stream in the correct format that I can examine?

hpennington commented 7 years ago

This could be an interesting problem to work on. Is the bounty still active? Thanks!

camswx commented 6 years ago

Bounty is still available.

armand1m commented 6 years ago

I will start working on this. Seems quite trivial.

armand1m commented 6 years ago

Hey, I've been reading the introduction to contributing to this code, already forked it, read the basics about the architecture, and saw the entrypoint for the application. As I never constructed a TerriaJS app before, I also bootstrapped an empty project to have a substancial idea on how is the developer experience when constructing applications using TerriaJS.

I would like to know more specifically what is the acceptance criteria for this issue.

I've been reading the docs and could find that the user has some kind of Catalog where he is able to find dozens of types of datasources where he is able to connect his application to.

Basically we want to add another Catalog Group, Catalog Item, or Catalog Function?

Also, the Catalog Type would be something like "Realtime Resource (Socket.io)"?

I would like to come up with some discussion around this to know exactly what would be the best solution for this =)

Resources I've read until now:

http://terria.io/Documentation/guide/contributing/ http://terria.io/Documentation/guide/contributing/development-environment/ http://terria.io/Documentation/guide/contributing/architecture/ https://github.com/TerriaJS/terriajs/blob/master/CONTRIBUTING.md

http://terria.io/Documentation/guide/getting-started/ http://terria.io/Documentation/guide/connecting-to-data/ http://terria.io/Documentation/guide/connecting-to-data/catalog-groups/

(if anyone would like to refer to some additional docs that may help, I would love it as well ❤️)

armand1m commented 6 years ago

Also, should we add another tab here related to Realtime Resources? Or should we just create a new option inside the "Add Web Data" tab? captura de tela 2018-05-11 as 02 34 01

kring commented 6 years ago

Thanks for your interest @armand1m! @metanomy / @camswx, please jump in if you disagree on any of this since it's your bounty, but here's my take...

I think you'll want to extend CzmlCatalogItem. CZML is a format defined by Cesium. You can read more about CZML here: https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide

CZML is designed for time-varying things, and supports real-time updates. Currently, CzmlCatalogItem loads a CZML file from a URL by calling load on CzmlDataSource. You'll want to create an option to instead provide a socket.io endpoint which continually receives CZML packets and incorporates them into the datasource by calling the process method.

I don't think there's a need to add new tabs anywhere in the UI. The configuration should happen in the JSON catalog definition. It could be cool to add a "CZML from socket.io" option to the Add Web Data tab, but I think that's separate from the core of this issue.

armand1m commented 6 years ago

@kring thanks very much for such detailed information. I've been reading about Cesium and CZML as well.

I'll try to come up with a socket io example server for pushing generated CZML packets in an interval of time, as this will help to get this implementation setup. If anyone has any suggestions, I would love as well.

I'll try to extend this model in order to add this feature. Still, I don't how complex doing this can be, yet it sounds not so complicated =)

I'll start this adventure today at night, probably in 10 hours from now.

camswx commented 6 years ago

@armand1m I recommend using OpenSensorHub (http://www.opensensorhub.org) that generates SensorML JSON (see the example here: http://docs.opengeospatial.org/bp/17-011r2/17-011r2.html#26). This might meet doing SensorML->CZML conversion on the fly, but I'm willing to add more to this bounty to make that happen. Let me chat with @tabinfl - we can probably set up an OSH/socket io server for you today.

armand1m commented 6 years ago

@camswx that would be lovely mate =) If you guys are able to come up with this asap, please share the repo link here with a comprehensive README.md so I can use it for the development of this issue.

I'm not familiar to SensorML JSON, but taking your example as a reference, I can presume that you would like to have realtime information about sensors in the "Feature Information" modal, right?

For your request, I would like to have more information about how we would connect SensorML data to this feature _(use cases, examples, would help a lot :slightly_smilingface:)

kring commented 6 years ago

Ah ok so based on what @camswx just said, I think we're now talking about a new catalog item, SensorMlJsonCatalogItem maybe. This new catalog item would create a CustomDataSource on load and create/remove entities and adjust their properties according to the incoming SensorML stream.

armand1m commented 6 years ago

Ok, shall we create another issue for @camswx request? So we can keep it simple?

kring commented 6 years ago

@camswx and @metanomy are the same person, so I think we're talking about a refinement of what he'd like to see, rather than a separate issue.

camswx commented 6 years ago

@kring Exactly - refinement.

vheuken commented 6 years ago

@camswx / @metanomy I have started working on this. I've created and registered a basic model. Now I'm going to try and setup a Socket.io server to implement against.

I noticed you said

Let me chat with @tabinfl - we can probably set up an OSH/socket io server for you today.

earlier. Are you still willing to do that? I'd like to be able to test against something of yours so that I know I'm heading in the right direction.

joshua-j-morley commented 3 years ago

Hey gang, just discovered Terria 2 days ago loving it so far I'm from an IoT/Cloud background and can see great potential in the modelling especially with real time data, very keen on getting more involved

Is this still open now? Some of the examples i've seen such as NSW transport digital twin, they have a section for live data https://nsw.digitaltwin.terria.io/