Comments (3)
Ok. I fixed the issue in commit f9bfc79
Now GeoPath, GeoPoint, Nvector and ECEFvector and Pvector return scalars for the case where the input is not actually arrays of points but just single objects.
from nvector.
Thanks for the notification on this inconsistency.
Actually, both GeoPath(pointA, pointB).track_distance(method='great_circle') and
GeoPath(pointA, pointB).track_distance(method='euclidian') returns an array of m = max(len(pointA), len(pointB)) values.
Note this works either if len(pointA)==len(pointB) or len(pointA)==1 or len(pointB)==1.
In other words it returns all paths between point A and B even if one or both are given as an vector of points..
However, GeoPath(pointA, pointB).track_distance(method='exact') raises a ValueError for m>1.
Also
GeoPath(pointA, pointB).cross_track_distance(pointC, method='great_circle') and
GeoPath(pointA, pointB).cross_track_distance(pointC, method='great_circle') both returns arrays of length m
where m = max(len(pointA), len(pointB), len(pointC)) and either len(pointA)==len(pointB)==len(pointC) or len(pointA)==1 or len(pointB)==1 or len(pointC)==1.
Thus, I am inclined to document this vectorized behavior and make sure GeoPath.track_distance(method='exact') respond in the same way.
from nvector.
Thanks for the explanation! I actually had no idea GeoPath
supported vectorized operations.
Still, in order to not confuse the user (me 😉) to much it would be nice to return scalars for the case where the input is not actually arrays of points but just single objects. Compare for example with numpy where functions such as numpy.add returns a scalar if it is provided with scalar inputs but an array if it is provided with arrays as input.
While on the topic of type inconsistencies, I also noticed that GeoPoint
sometimes returns latitude and longitude as scalars and sometimes as length 1 arrays. I assume this has a similar reason/explanation?
from nvector.
Related Issues (13)
- path.positionA not always on path when using the exact method HOT 3
- use of np.isclose to compare number close to 0 HOT 6
- Example not working HOT 2
- Find GeoPosition from GeoPosition and cartesian vector HOT 1
- KeyError: 'point' in __repr__ of Pvector HOT 2
- `GeoPath.intersect` should return `GeoPoint`
- Suggestion: make `Cartopy` and opt-in dependency
- latlon_deg property gives different types for linux vs windows HOT 1
- Conda-forge
- test for test_n_E_and_wa2R_EL seems incorrect HOT 2
- new version with updated Sphinx HOT 1
- Cross track distance ill conditioned HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvector.