add checks for border margin to more rtgeom routines