Skip to content
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

Support for more generic Space Oblique Mercator (SOM) projection #3338

Merged
merged 11 commits into from
Sep 27, 2022
Merged

Support for more generic Space Oblique Mercator (SOM) projection #3338

merged 11 commits into from
Sep 27, 2022

Conversation

sval-dev
Copy link
Contributor

@sval-dev sval-dev commented Sep 22, 2022

@rouault
Copy link
Member

rouault commented Sep 22, 2022

To avoid the code duplication, if the only difference is hard-coded parameters vs user-provided one, a better way would be to have a common setup() method to misrom and genericsom, and have the entry points of the 2 functions call it. Like "utm" and "tmerc" in src/projections/tmerc.cpp (there are other similar instances in sconics.cpp, putp6.cpp, etc.)

@sval-dev
Copy link
Contributor Author

I think I understand.

From my point of view, it looks like misrsom is a more specialized version of genericsom.

Would it work for you to keep the currently duplicated code in genericsom (with modification if necessary to support re-use) and modify misrsom to use the functions from genericsom rather than be duplicated?

@rouault
Copy link
Member

rouault commented Sep 22, 2022

Would it work for you to keep the currently duplicated code in genericsom (with modification if necessary to support re-use) and modify misrsom to use the functions from genericsom rather than be duplicated?

that's exactly what I meant :-) Basically you'd remove misrom.cpp entirely, and just move its entry point PJ *PROJECTION(misrsom) inside genericsom.cpp and make it reuse genericsom code but with the few needed parameters hardcoded.

@sval-dev
Copy link
Contributor Author

Thanks! I'll make the change and push once more.

src/projections/genericsom.cpp Outdated Show resolved Hide resolved
src/projections/genericsom.cpp Outdated Show resolved Hide resolved
test/cli/tv_out.dist Outdated Show resolved Hide resolved
test/cli/testvarious Outdated Show resolved Hide resolved
src/lib_proj.cmake Outdated Show resolved Hide resolved
@rouault rouault added this to the 9.2.0 milestone Sep 23, 2022
@kbevers kbevers merged commit d30d4ea into OSGeo:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for more generic Space Oblique Mercator (SOM) projection
3 participants