Open mdsumner opened 5 years ago
A superficial fix for the start of some of the issues here is in this remote commit. That at least introduces an initial degree of robustness that I think should be present, although of course this has effects that will still need to be processed downstream because the resultant table will have empty topology_
entries.
There are also of course larger issues at play. I do concur with your general assumptions / visions up until now that the object
and object_link_edge
tables should generally accord. I do think this also makes sense in the osmdata_sc
context, and can mostly be reconciled by ensuring that every object_link_edge$object_
is also present in the object
table itself. This will not necessarily be so, because my osmdata_sc
vision to now has been of the object
table more as equivalent to a "feature" matrix so that, for example, SC(an_sfc_list)
would yield an empty object table. I can easily reconcile that with your vision by ensuring that nrow(SC(an_sfc_list)$object) == nrow(SC(an_sfc_list)$object_link_edge)
. This requires simply inserting some effectively empty entries in the object
table, much as the commit linked above does for SC0
.
It does not, however, solve a coupla larger issues.
osmdata_sc
will still generate a lot of duplicated object$object_
entries for reasons described in the osmdata_sc
issue, so in general nrow(x$object)
will be quite a bit more than nrow(x$object_link_edge)
, and I don't see any way around that (all sphier
-like considerations and whatnot). That of course may make it tricky when joining object
and object_link_edge
tables, but the object
table could easily be spread
prior to that act, I'd suggest.identical(SC(minimal_mesh), SC(minimal_mesh) %>% SC()) # FALSE
? I need that vision to really be able to work towards a solution here.
They are randomly generate UIDs, no two will ever be the same (though SC0 ought to be, with some caveats around coordinate precision/identity).
identical(SC(minimal_mesh), SC(minimal_mesh))
# [1] FALSE
set.seed(10)
x <- SC(minimal_mesh)
set.seed(10)
identical(x, SC(minimal_mesh))
[1] TRUE
Oh yeah, stupid me, of course. Ta! Oh no, but hey, this is going to affect the osmdata_sc
kind of stuff, because those IDs should be enduring and propagated throughout. I'll delve in myself there ...
There is a missing SC.SC <- function(x, ...) x
- the other models have that shortcut - but I guess you meant more generally as well.
silicate is currently very naive in what it tries to do, and if there's a disconnected between the set of
object$object_
andobject$object_link_edge
then conversions toSC0
and so on will fail (trySC0(x)
).Assuming:
we can get around both of these, by filtering out parents that don't get reference, and ignoring links that go nowhere - but there'll need to be some kind of formalism around this.
Reprex for a given example from osmdata_sc:
Created on 2018-11-27 by the reprex package (v0.2.1)