Reputation: 39
I am gettin x = [inf inf inf.....] and y = [inf inf inf...]. Has anyone encountered this error before? I am attempting to convert lon and lat into x y values. I have the following code but I cannot figure out what is incorrect. This is San Diego data set.
import scipy.io;
from pyproj import Proj;
canyon = scipy.io.loadmat('INIT.MAT');
topo = canyon.get('siocanyon');
lat = tuple(topo[:, 0])
lon = tuple(topo[:, 1])
z = topo[:, 2]
myProj = Proj(proj='utm', zone=11, ellps='WGS84', preserve_units=False)
y, x = myProj(lon, lat)
Upvotes: 1
Views: 818
Reputation: 2789
I just tested the code with a sample position from San Diego:
from pyproj import Proj
lat = 32.715687
lon = -117.161380
#z = 100
myProj = Proj(proj='utm', zone=11, ellps='WGS84', preserve_units=False)
x, y = myProj(lon, lat)
print(x, y)
gives
484876.3791751535 3619780.206742558
You can test your results using an online converter.
Upvotes: 0