-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tofloat(Point) #1604
Add tofloat(Point) #1604
Conversation
475f41f
to
fb741f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overloading the constructors for primitive types is a bit risky. Is there a downside to defining a function that does this, like Geometry.first_coordinate(::Point)
?
This function also converts to the specified float type. This is not strictly needed, but it is nice to have. |
Yes, a more "standard" way to implement this would be something like |
fb741f5
to
cc70338
Compare
I added a function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the two changes I suggested, I'm fine with this PR.
cc70338
to
12b1ebc
Compare
It is easy to go from a number to a Geometry.Point, but it is not easy to go in the other direction (unless the type of point of point is known). This PR adds a new function `tofloat` to X/Y/Z/Lat/Long point to convert them into numbers. This feature would be very useful in converting a Field of ZPoints into a scalar field, which is what we need for the interpolation routines
12b1ebc
to
ee27f1a
Compare
It is easy to go from a number to a Geometry.Point, but it is not easy to go in the other direction (unless the type of point of point is known). This PR adds new methods to Float32, Float64, and BigFloat to X/Y/Z/Lat/Long point to convert them into numbers.
This feature would be very useful in converting a Field of ZPoints into a scalar field, which is what we need for the interpolation routines