mdsumner / sctrip

trip reboot
2 stars 0 forks source link

Direction #2

Open mdsumner opened 7 years ago

mdsumner commented 7 years ago

I am concentrating on user-flexibility for the "unjoin" on a single table, a key pattern to split out the geometry space, de duplicate and key to the remaining data. This is the basis of path topology for many data streams and is a dual to many nested table structures that are in common use. (The polygon decomposition is just a specialist input type from this perspective.) Flipping between path- and primitive- models is a key part of a grammar with all the small pieces needed for useful intermediate forms.

The grammars of graphics and analysis in modern R provide a lot of support for restructurings like this, but common pipelines that end in a graphic or other grouped structure don't go the full distance to output a "spatial data" set. The unjoin and its counterpart evert provide keystones for the path/primitive flip.

mdsumner commented 7 years ago

It's now clear that path, object are special cases of groupings. Simple features has three kinds of grouping:

ok four:

The feature is always the highest grouping level. I've been missing that the kludgy encoding of holes was hiding the fact that these are already multi-level features to sc. So, counties within states is just another level: holes within POLYGON within MULTIPOLYGON within county within state within country.

Simple features is just a special case applied to the grouping kinds above.

ggplot2 doesn't have multi-levels, but dplyr does. What about ggvis? Probably not, simple features clashes with graphics when there's an extra level like this.

mdsumner commented 7 years ago

See inst/topology in scsf for an approach to identifying unique segments (unique by ignoring direction).

http://rpubs.com/cyclemumner/neighbours02

The PRIMITIVE model needs somehow to deal with this. Maybe PATH should always include the direction-bound segments? Or a Path-link-segment table that identifies the direction of the segment.

Or another model between PATH and PRIMITIVE.

PATH - the ordered paths against the vertex pool MIDDLE-THING - a path-link-segment table PRIMITIVES - the pure unordered segments

it's not yet clear how MIDDLE-THING makes this tidier, perhaps there are just a few of them.