-
Notifications
You must be signed in to change notification settings - Fork 1
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
HIMAN-329: Short circuit coordinate transformation logic #4
Conversation
Himan transforms coordinates between projections (with gdal) using latlon as an intermediate representation. This introduces some very small numerical inaccuracies, which eventually push some valid grid points outside the grid in some circumstances. Introduce a "bulk" transformation method where coordinate transformation is done directly from source to target utilizing gdal methods. Implemented only for regular grids.
|
||
/* Return grid point value (location) of a given target grid */ | ||
virtual std::vector<point> XY(const regular_grid& to) const; | ||
|
||
/* Return latitude-longitude value for a given location index */ |
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.
I personally wouldn't define a bunch of new functions for the bulk calculations but use the single point functions as unary operators in std:transform algorithm library 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.
The bulk function is using a slightly different method to transform coordinates, hence it cannot be done the way you describe.
Is this the place to make general comments on the commit? |
I don't know but why not :D |
Just trying out the interface |
himan-lib/source/grid.cpp
Outdated
@@ -80,6 +80,10 @@ void grid::UVRelativeToGrid(bool theUVRelativeToGrid) | |||
{ | |||
itsUVRelativeToGrid = theUVRelativeToGrid; | |||
} | |||
std::vector<point> grid::GridPointsInProjectionSpace() const | |||
{ | |||
throw runtime_error("grid::GridPointInProjectionSpace() called"); |
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.
GridPointIn.. -> GridPointsIn..
Himan transforms coordinates between projections (with gdal) using latlon
as an intermediate representation. This introduces some very small numerical
inaccuracies, which eventually push some valid grid points outside the grid
in some circumstances.
Introduce a "bulk" transformation method where coordinate transformation is
done directly from source to target utilizing gdal methods. Implemented only
for regular grids.