hypertidy / silicate

A general form for complex data
https://hypertidy.github.io/silicate/
54 stars 4 forks source link

1D topology as paths #25

Closed mdsumner closed 6 years ago

mdsumner commented 7 years ago

This is a very general requirement, it sits right in the middle of the limitations of simple features.

Polygons as paths are a very specialist structure, they don't really occur naturally - we tend to draw them. Patches of areas within a plane are very natural however, but they occur in less direct ways such as clusters of finite elements with either implicit boundaries (i.e. rasters with contiguous values, or non-vary measurments within point patters).

Paths though do occur very naturally, any sensor data stream measured over time is a path. It might not be appropriate to consider it as continuous between samples, but it still makes sense in that it's an ordered set of observations.

tidy grammars excel at deriving structure from users in this way

d %>% 
   group_by(ID)  %>% ## grouping is optional, might be only one group
   arrange(datetime)  %>% ## traditionally we'd arrange(group, datetime), treating "group" especially
   ggplot(aes(x = lon, y = lat, colour = depth))   ## etc. etc. 

At the end of the pipeline above the only option we have currently is to create visualizations, but better would be to be able to format the user-expressed organization into anything we want, something like osmdata_sf does from its data streams, but we want every other kind of format as well, including rgl, trip, any number of htmlwidgets inputs, and very many modelling frameworks like adehabitatLT and move and so on.

I think ggvis was a better stab at this idea, but its idea of "primitives" is very much about the objects in the browser rather than those intermediate forms that so many other data structures are composed of. The tidyverse really needs this.

This concept pops up in so many places I've got a lot of fragmented pieces, so this list exists to hopefully help me pull them all together eventually. The crux is having facilities for paths as directed segments, i.e. topology independent of any geometry (data frames can store any number of dimensions of coordinates).

See rebuilding polygons from filtered segment-graph here: https://rpubs.com/cyclemumner/291559 https://rpubs.com/cyclemumner/291560 https://rpubs.com/cyclemumner/291561

This is where I first did a "cycle-detection" to rebuild polygons from primitives: https://github.com/mdsumner/gris/blob/master/R/trianglePrimitives.R

Segments for paths to help with vector field / trajectory comparison

https://github.com/r-gris/pathos/issues/1

https://github.com/r-gris/rangl/blob/master/R/rangl-trip.r

https://github.com/Trackage/trip/blob/aes/R/gg-aesthetics.R

https://github.com/r-gris/pathos

https://github.com/mdsumner/sctrip/issues/2

mdsumner commented 6 years ago

This is pretty much resolved, the SC model will do all this