r-spatial / cesium

Cesium wrapper to R
33 stars 4 forks source link

Experimental implementation of an R cesium package #3

Open goergen95 opened 1 year ago

goergen95 commented 1 year ago

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:

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:

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

Best, Darius.

tim-salabim commented 1 year ago

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?

goergen95 commented 1 year ago

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.