r-spatial / cesium Goto Github PK
View Code? Open in Web Editor NEWCesium wrapper to R
Cesium wrapper to R
Just curious. I am looking for a globe map solution, but am wary of spending time adapting things to Cesium if it development has been dropped (unless, of course, it is stable and there's nothing else to be added to interface with cesium).
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:
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.
Looks cool! When I try this, I see the folloing error in the browser:
An error occurred while rendering. Rendering has stopped.
SecurityError: Failed to construct 'Worker': Script at 'file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Workers/cesiumWorkerBootstrapper.js' cannot be accessed from origin 'null'.
Error: Failed to construct 'Worker': Script at 'file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Workers/cesiumWorkerBootstrapper.js' cannot be accessed from origin 'null'.
at g (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:477:22385)
at y.scheduleTask (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:477:23476)
at g.createMesh (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:477:28947)
at L (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:541:2730)
at M (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:541:1281)
at Function.P.processStateMachine (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:541:5565)
at J.loadTile (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:542:26654)
at z (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:543:23180)
at B (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:543:22904)
at b.endFrame (file:///tmp/RtmpGKS8wG/viewhtmla8f7c9cf8ba/lib/Cesium-1.61/Cesium.js:543:26513)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.