[R-sig-Geo] gUnion: no outgoing dirEdge found
Brian J. Stults
bstults at fsu.edu
Fri Jun 17 22:27:52 CEST 2011
On 06/17/2011 04:03 PM, Roger Bivand wrote:
> On Fri, 17 Jun 2011, Brian J. Stults wrote:
>
> no error exit - is this a script running on a node, if so, could you
> catch errors with try() or similar means? I am in doubt about whether
Yes, it is a script. Wrapping the command in try() or tryCatch()
resulted in the same output, as did running the commands interactively.
> your approach is sensible, and suspect that running gEquals(de1990,
> de2000, byid=TRUE) first to establish the duplicates, then tackle the
> ones which are not seen as equal. Most of the polygons are the same:
Delaware 1990-2000 is probably not a good example since tracts did not
change much. Indeed, that's why I chose it to test with, so it might
run more quickly and be less confusing to me. When I union 1970 and
2010, there will be many more differences (though fewer tracted areas in
1970).
>
> eq <- gEquals(de1990, de2000, byid=TRUE)
> sum(apply(eq, 2, any))
> sum(apply(eq, 1, any))
> plot(de1990, col="cyan", border="transparent")
> plot(de1990[apply(eq, 2, any),], add=TRUE)
> nde1990 <- de1990[!apply(eq, 2, any),]
> nde2000 <- de2000[!apply(eq, 1, any),]
>
> then step through int row by row (or column by column) to union the ones
> for which the correct predicate is TRUE for that combination. I'm unsure
> whether you want to dissolve to the 2000 file or the other way round, or
> to create sub-units permiting either to be reconstructed, so I can't
> suggest further steps now. The predicates should let you find the
I want to retain all sub-units, so I think the last option you listed is
what I want.
> geometries on which topology operations are to be performed, which
> should then work provided that the shapefiles are clean. The trick seems
> to be in finding the right predicates, then the right operation, but it
> needs interactive analysis to work through use cases and instrument a
> script to be sure that the correct joins are being made.
I very much look forward to being capable of doing what you suggest, but
right now I think it is beyond my coding ability in R. I hate to give
up so quickly, but perhaps the better option for now is compiling Qgis
on the supercomputer and running the union that way. But I *will*
eventually learn how to do it in R.
Thanks!
More information about the R-sig-Geo
mailing list