You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the numpy interface returns all the data in the lat/long arrays in the same zone regardless of how many zones the data actually spans. For example, here are some lat/longs in Texas that span 6 zones. When you run each data point through utm.from_latlong individually you get the right UTM zones (6) with output as shown below:
result = []
for lat,long in zip(df['lat'],df['long']):
result.append(utm.from_latlong(lat,long))
If you instead put those lat/long pairs into numpy arrays and then feed them through utm.from_latlong all at once, they all get projected into a single utm zone, which appears to be the first one in the dataset:
It appears that the numpy interface returns all the data in the lat/long arrays in the same zone regardless of how many zones the data actually spans. For example, here are some lat/longs in Texas that span 6 zones. When you run each data point through utm.from_latlong individually you get the right UTM zones (6) with output as shown below:
31.536598 -103.669795 626277.957127 3.489840e+06 13R
33.044924 -102.473123 721477.858368 3.601393e+06 13S
30.427469 -96.538430 736424.325834 3.368727e+06 14R
33.349272 -100.655458 344773.270375 3.694674e+06 14S
31.276065 -95.483046 263604.667649 3.462858e+06 15R
32.061439 -95.761137 239325.564516 3.550582e+06 15S
To be clear, this result is from doing:
If you instead put those lat/long pairs into numpy arrays and then feed them through utm.from_latlong all at once, they all get projected into a single utm zone, which appears to be the first one in the dataset:
(array([ 626277.95712696, 735961.8832752 , 1314026.08573693,904396.7559105 , 1407848.61383494, 1373735.1761227 ]), array([3489839.70071501, 3659105.6188487 , 3396735.53928308, 3698446.73936288, 3499566.456626 , 3584840.23674779]), 13, 'R')
result = utm.from_latlong(df['lat'].values,df['long'].values)
The text was updated successfully, but these errors were encountered: