Skip to content

Commit e072dd7

Browse files
committed
fix issue 209: failure to reproject C-non-contiguous numpy arrays
1 parent fcc8798 commit e072dd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/mpl_toolkits/basemap/pyproj.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,13 @@ def _copytobuffer(x):
517517
return _copytobuffer_return_scalar(x)
518518
else:
519519
try:
520+
import numpy as np
520521
# typecast numpy arrays to double.
521522
# (this makes a copy - which is crucial
522523
# since buffer is modified in place)
523524
x.dtype.char
524-
inx = x.astype('d')
525+
inx = x.astype('d', order="C")
526+
525527
# inx,isfloat,islist,istuple
526528
return inx,False,False,False
527529
except:

0 commit comments

Comments
 (0)