Open AlexAtCCRI opened 1 year ago
Encoutering the same issue.
Here https://github.com/geospace-code/pymap3d/blob/81172e221a4c9884450a38ec8a7ee382198cb7e3/src/pymap3d/vincenty.py#L172 and https://github.com/geospace-code/pymap3d/blob/81172e221a4c9884450a38ec8a7ee382198cb7e3/src/pymap3d/vincenty.py#L232 lamb
is set to a float, even when the inputs are numpy arrays. The cause an exception here https://github.com/geospace-code/pymap3d/blob/81172e221a4c9884450a38ec8a7ee382198cb7e3/src/pymap3d/vincenty.py#L264 which is then handled incorrectly.
The fix should be to assign arrays to lamb
if the input is arrays.
The whole approach to handle numpy arrays and normal floats with the same code seems a bit brittle to me however. I would create two separate implementations, even that means some code duplication.
What happened?
for some points in my dataframe the
vdist
azimuth solving part has a bug. however, if i look through the rows one at a time ( and pass scalar values instead of arrays to vdist) it works.as a work-around it would be nice to have a `dist_only=True option which skips all this code.
Relevant log output