Skip to content

How the "gSymdifference" of rgoes package calculating the symmetric distance between two polygon

2 messages · Kaushik Jana, Chris English

#
Dear all,

I want to calculate the symmetric distance between two polygon. I learned
that "gSymdifference" and "gArea" of "rgoes" can be used for that purpose.
But I am not getting how this difference is calculated (what are R-codes).

The code I am getting by straight forward typing the "gSymdifference" is
giving me:
function (spgeom1, spgeom2, byid = FALSE, id = NULL, drop_lower_td = FALSE,
unaryUnion_if_byid_false = TRUE, checkValidity = FALSE)
{
if (checkValidity) {
val1 <- gIsValid(spgeom1)
val2 <- gIsValid(spgeom2)
if (!val1)
message(deparse(substitute(spgeom1)), " is invalid")
if (!val2)
message(deparse(substitute(spgeom2)), " is invalid")
if (!all(c(val1, val2)))
stop("Invalid objects found")
}
return(RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td,
unaryUnion_if_byid_false, "rgeos_symdifference"))
}
<environment: namespace:rgeos>

The above is not helping for this purpose. Where from I can get the codes
of the functions and get to know how the "gSymdifference" and "gArea" is
calculating the difference?

Thanks a lot for your time.

Sincerely,

Kaushik
20 days later
#
Hi Kaushik,

Strictly speaking that is the R code that is calling another library GEOS,
originally implemented in Java, and ported to c++. Poking around in your
GEOS library may lead to area gSimdifference. If there were developer
issues or discussions regarding implementation of area and Simdifference,
googling Sandro Santilli and the term of interest might prove useful.
HTH,
Chris

On Mon, May 2, 2016 at 11:03 AM, Kaushik Jana <kaushikjana11 at gmail.com>
wrote: