R/spatial_sync_vector.R

#' spatial_sync_vector
#' @param unsynced TODO
#' @param reference TODO
#' @param verbose Logical. TODO
#' @export

spatial_sync_vector <- function(unsynced,reference,verbose=TRUE)
{
	require("rgdal")
	new_projection=projection(reference)
	old_projection=projection(unsynced)

	if(new_projection!=old_projection)
	{
		synced_vector=spTransform(unsynced,CRS(new_projection))
	} else
	{
		synced_vector=unsynced
	}
	if(verbose){ print(projection(synced_vector)) } 
	return(synced_vector)
}

Try the STARStools package in your browser

Any scripts or data that you put into this service are public.

STARStools documentation built on May 2, 2019, 6:48 p.m.