diff --git a/lib/cartopy/_crs.pyx b/lib/cartopy/_crs.pyx index a45dcacf9..edf36e242 100644 --- a/lib/cartopy/_crs.pyx +++ b/lib/cartopy/_crs.pyx @@ -140,17 +140,23 @@ cdef class CRS: return (cx, cy) def transform_points(self, CRS src_crs not None, - np.ndarray[np.double_t, ndim=1] x not None, - np.ndarray[np.double_t, ndim=1] y not None, - np.ndarray[np.double_t, ndim=1] z=None): + np.ndarray x not None, + np.ndarray y not None, + np.ndarray z=None): cdef np.ndarray[np.double_t, ndim=2] result + if z is None: + if x.ndim != 1 or y.ndim != 1: + raise ValueError('x and y arrays must be one dimensional') if x.shape[0] != y.shape[0]: raise ValueError('x and y arrays must have the same length') - elif not x.shape[0] == y.shape[0] == z.shape[0]: - raise ValueError('x, y, and z arrays must have the same length') + else: + if x.ndim != 1 or y.ndim != 1 or z.ndim != 1: + raise ValueError('x, y and z arrays must be one dimensional') + if not x.shape[0] == y.shape[0] == z.shape[0]: + raise ValueError('x, y, and z arrays must have the same length') npts = x.shape[0] diff --git a/lib/cartopy/mpl_integration/geoaxes.py b/lib/cartopy/mpl_integration/geoaxes.py index b26b81da7..d3b9d2611 100644 --- a/lib/cartopy/mpl_integration/geoaxes.py +++ b/lib/cartopy/mpl_integration/geoaxes.py @@ -62,11 +62,6 @@ def __repr__(self): def transform_non_affine(self, xy): """Transforms from native coordinates to lat lons.""" if isinstance(xy, numpy.ndarray): -# print xy.shape -# x, y = xy[:, 0:1], xy[:, 1:2] -# r = [] -# for xpt, ypt in zip(x, y): -# print xpt, ypt return self.target_projection.transform_points(self.source_projection, xy[:, 0], xy[:, 1])[:, 0:2] else: x, y = xy