r-spatial/cesium

Experimental implementation of an R cesium package

Opened this issue · 2 comments

Hi @tim-salabim,

I have a working experimental implementation of an R {cesium} package ready here.
This is highly experimental, expect most things you would like to do not to work properly! ;)

The documentation is only basic, however, I prepared several usecases
which showcase some applications. Note, these require to download some data which I could not include
in the repository due to size constrains. Running renv::hydrate() from the project directory,
should install all required dependencies to run the usecases.

The JavaScript binding currently is pretty slim. The main reason for this is my inability to write proper JavaScript code.
The package is basically an sf-to-CZML converter, which can easily be rendered on a globe by calling the
respective CesiumJS method.

CZML is a JSON-based specification to describe space-time data. To me, it seems like quite an interesting format specification
which is not an official OGC standard, yet. My understanding is that AGI might try to move it into that direction.

In the README you will find a small overview of the things that are already implemented and what is missing.

Briefly, with cesium we can:

  • add points,
  • add markers,
  • add labels,
  • add lines,
  • add polygons,
  • add rasters,

to an interactive globe with the possibility to include a temporal dimension and
fine-control over properties such as color or size, among other things.
Most importantly, methods for legends and toggling off layers are missing.

Internally, I used sf and stars for handling spatial data.
Proper normalization methods for other spatial data classes, e.g. terra, are yet to be developed.

I mainly have two reasons to open this issue:

  • first, I would really appreciate some feedback on the initial design of the R interface.
    In the backend, I liberally copied methods from the leaflet package and also
    mimicked its user-facing API. I am specifically interested in feedback on the handling
    of space-time data. After some initial experiments with, e.g. stars and cubble,
    I opted for sf for geometries to be able to accommodate irregular time-series, but
    maybe there are better options out there?

  • second, I am looking for someone proficient in coding JavaScript interested in co-developing
    the package. I imagine setting up some initial infrastructure like a layer manager and re-usable
    methods that make it easy to extend the functionality upon feature-requests. Setting
    this up in a proper way is above my abilities, but I can imagine to also contribute
    to the maintenance of the JS code base once it has matured.

Of course, any kind of feedback going beyond those items is appreciated!

Best,
Darius.

Hi @goergen95, this is great work! I have yet to properly try it out, but I am impressed already! Regarding your two questions:

I am specifically interested in feedback on the handling
of space-time data. After some initial experiments with, e.g. stars and cubble,
I opted for sf for geometries to be able to accommodate irregular time-series, but
maybe there are better options out there?

Maybe @edzer has some thoughts here, there is a sftime package, but I am not sure how mature it is

I imagine setting up some initial infrastructure like a layer manager and re-usable
methods that make it easy to extend the functionality upon feature-requests. Setting
this up in a proper way is above my abilities

Same here unfortunately... Maybe an annoucement on Mastodon or r-sig-geo may spark someones interest?

Thanks for that initial feedback! Hope you can try it out soon.
We could also think about reviving r-spatial/discuss#29 since there was some initial interest in developing a cesium R package.