handle corner cases properly in rtgeom routines