Skip to content

Commit

Permalink
Added test for unicity of ids
Browse files Browse the repository at this point in the history
  • Loading branch information
fraba committed Jan 30, 2019
1 parent e42f476 commit 6737364
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/reconcileGeographies.R
Expand Up @@ -44,6 +44,14 @@ reconcileGeographies <- function(polyA, polyB,
project_crs <- sf::st_crs(polyB)
}

if(any(duplicated(as.character(polyA[[idA]]))) {
stop("Duplicated ids in idA")
}

if(any(duplicated(as.character(polyB[[idB]]))) {
stop("Duplicated ids in idB")
}

polyA[['.unigeokey']] <- as.character(polyA[[idA]])
polyB[['.unigeokey']] <- as.character(polyB[[idB]])

Expand Down

0 comments on commit 6737364

Please sign in to comment.