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

Dispatch content of 4D_api.cpp into multiple .cpp files #4393

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

rouault
Copy link
Member

@rouault rouault commented Feb 4, 2025

No functional change, just moving code around.

4D_api.cpp has become quite large and a set of 'random' things, that didn't correlate well with the '4D' naming. Some re-organization was needed.

Create following files:

  • src/area.cpp: PJ_AREA related code
  • src/coordinates.cpp: functions related to coordinate manipulation
  • src/coord_operation.cpp: PJCoordOperation methods
  • src/create.cpp: pj_create_internal() related stuff
  • src/crs_to_crs.cpp: proj_create_crs_to_crs() and the like
  • src/dist.cpp: distance related functions
  • src/info.cpp: proj_info() and proj_pj_info()
  • src/trans.cpp: proj_trans(), proj_trans_array(), proj_trans_generic(), proj_roundtrip()
  • src/trans_bounds.cpp: proj_trans_bounds()

Some other functions also moved to more relevant existing source files.

@rouault rouault added the funded through GSP Work funded through the GDAL Sponsorship Program label Feb 4, 2025
@rouault rouault added this to the 9.6.0 milestone Feb 4, 2025
@rouault rouault force-pushed the split_4D_api branch 2 times, most recently from 61da477 to 0271829 Compare February 4, 2025 14:05
@kbevers
Copy link
Member

kbevers commented Feb 4, 2025

This is a much needed restructuring. It's a lot simpler to navigate the code this way.

It seems all the functions in misc.cpp is related to coordinates, one way or another. Would it make sense to simply call it coordinates.cpp?

@rouault
Copy link
Member Author

rouault commented Feb 4, 2025

Would it make sense to simply call it coordinates.cpp?

I don't know. One of my initial thoughts was that it was mostly about units... But as that wasn't completely the case, I preferred misc... Not opposed to "coordinates", but I've about the same mixed feeling as "units"

@kbevers
Copy link
Member

kbevers commented Feb 4, 2025

I'm not a massive fan of having "misc" or "utils" modules in a code base. It's never really obvious what's to be expected in them. Sometimes you really need a place to put random functions but in this case I think there is actually a common thread and the filename may as well reflect that. "coordinates" was what immediately came to my mind. There may be a better name for it.

@rouault
Copy link
Member Author

rouault commented Feb 4, 2025

Would it make sense to simply call it coordinates.cpp?

ok, I've settled on that

@rouault rouault changed the title Dispatch content of 4D_api.cpp into multiple .cpp files, and rename the remainder as misc.cpp Dispatch content of 4D_api.cpp into multiple .cpp files Feb 4, 2025
No functional change, just moving code around.

4D_api.cpp has become quite large and a set of 'random' things, that
didn't correlate well with the '4D' naming. Some re-organization was needed.

Create following files:
- src/area.cpp: PJ_AREA related code
- src/coordinates.cpp: functions related to coordinate manipulation
- src/coord_operation.cpp: PJCoordOperation methods
- src/create.cpp: pj_create_internal() related stuff
- src/crs_to_crs.cpp: proj_create_crs_to_crs() and the like
- src/dist.cpp: distance related functions
- src/info.cpp: proj_info() and proj_pj_info()
- src/trans.cpp: proj_trans(), proj_trans_array(), proj_trans_generic(), proj_roundtrip()
- src/trans_bounds.cpp: proj_trans_bounds()

Some other functions also moved to more relevant existing source files.
@rouault rouault merged commit 8326439 into OSGeo:master Feb 6, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants