Skip to content

Commit fe0cf0d

Browse files
committed
#219 try digest for object comparison
1 parent 4f4b646 commit fe0cf0d

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Description: Provides facilities to read, write and validate geographic metadata
1515
as well, such as the Sensor Web Enablement (SWE) Common Data Model, the OGC GML
1616
Coverage Implementation Schema (GMLCOV), or the OGC GML Referenceable Grid (GMLRGRID).
1717
Depends: R (>= 3.3.0)
18-
Imports: methods, R6, XML, httr, jsonlite, keyring, readr, crayon
18+
Imports: methods, R6, XML, httr, jsonlite, keyring, readr, crayon, digest
1919
Suggests: sf, ncdf4, EML, emld, units, testthat, roxygen2
2020
License: MIT + file LICENSE
2121
URL: https://github.com/eblondel/geometa/wiki

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ import(jsonlite)
469469
import(keyring)
470470
import(readr)
471471
importFrom(R6,R6Class)
472+
importFrom(digest,digest)
472473
importFrom(methods,as)
473474
importFrom(methods,is)
474475
importFrom(utils,packageDescription)

R/ISOAbstractObject.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#' @importFrom methods is
77
#' @importFrom methods as
88
#' @importFrom utils read.csv
9+
#' @importFrom digest digest
910
#' @import XML
1011
#' @import httr
1112
#' @import readr
@@ -1692,6 +1693,9 @@ ISOAbstractObject$compare = function(metadataElement1, metadataElement2, method
16921693
text2 <- as.character(metadataElement2)
16931694
}
16941695
same <- (text1 == text2)
1696+
},
1697+
"digest" = {
1698+
digest::digest(metadataElement1) == digest::digest(metadataElement2)
16951699
}
16961700
)
16971701
return(same)

R/profile.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"19115-3" = "https://standards.iso.org/iso/19115/resources/Codelists/cat"
99
)
1010
.geometa.options$internalCodelists <- TRUE
11-
.geometa.options$object_comparator <- "print"
11+
.geometa.options$object_comparator <- "digest"
1212

1313
#hidden objects
1414
assign(".geometa.iso", new.env(), envir= asNamespace(pkgname))

0 commit comments

Comments
 (0)