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

Add method DerivedProjectedCRS::demoteTo2D and implement promoteTo3D #3317

Merged
merged 3 commits into from
Sep 11, 2022

Conversation

jjimenezshaw
Copy link
Contributor

@jjimenezshaw jjimenezshaw commented Sep 9, 2022

DerivedProjectedCRS do not work properly with promoteTo3D and demoteTo2D.
This PR tries to implement that functionality.

  • Tests added
  • Added clear title that can be used to generate release notes

@jjimenezshaw jjimenezshaw force-pushed the promoteTo3D-derivedProjected branch from e055b9d to 163ad04 Compare September 11, 2022 10:10
@rouault
Copy link
Member

rouault commented Sep 11, 2022

Looks good to me. You just have to add the new symbol in scripts/reference_exported_symbols.txt as suggested below (you can also manually insert it from the suggestion of the diff if not running Linux)

 --- /tmp/reference_exported_symbols.txt	2022-09-11 10:16:28.063469486 +0000
+++ /tmp/got_symbols.txt	2022-09-11 10:16:28.091469784 +0000
@@ -169,6 +169,7 @@
 osgeo::proj::crs::DerivedGeographicCRS::~DerivedGeographicCRS()
 osgeo::proj::crs::DerivedProjectedCRS::baseCRS() const
 osgeo::proj::crs::DerivedProjectedCRS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::crs::ProjectedCRS> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::operation::Conversion> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::CoordinateSystem> > const&)
+osgeo::proj::crs::DerivedProjectedCRS::demoteTo2D(std::string const&, std::shared_ptr<osgeo::proj::io::DatabaseContext> const&) const
 osgeo::proj::crs::DerivedProjectedCRS::~DerivedProjectedCRS()
 osgeo::proj::crs::DerivedVerticalCRS::baseCRS() const
 osgeo::proj::crs::DerivedVerticalCRS::create(osgeo::proj::util::PropertyMap const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::crs::VerticalCRS> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::operation::Conversion> > const&, dropbox::oxygen::nn<std::shared_ptr<osgeo::proj::cs::VerticalCS> > const&)
Difference(s) found in exported symbols. If intended, refresh scripts/reference_exported_symbols.txt with 'scripts/dump_exported_symbols.sh lib/libproj.so > scripts/reference_exported_symbols.txt'

@jjimenezshaw
Copy link
Contributor Author

Looks good to me. You just have to add the new symbol in scripts/reference_exported_symbols.txt as suggested below (you can also manually insert it from the suggestion of the diff if not running Linux)

Thanks Even. I have just added that line.

Looks like I do not have to add anything to the *.rst documentation, right?

@rouault
Copy link
Member

rouault commented Sep 11, 2022

Looks like I do not have to add anything to the *.rst documentation, right?

no, nothing needed on the documentation side

You might also want to run the ./scripts/reformat_cpp.sh script to make sure the code is formatted consistently with the rest, but as you rightly adapted similar existing code, I suspect it should already be properly formatted (this isn't checked by CI, as this might be a bit painless for people with have not the right setup to run the formatter, so from time to time I run it on my side)

@jjimenezshaw
Copy link
Contributor Author

jjimenezshaw commented Sep 11, 2022

Does it make sense to do the same (promoteTo3D and demoteTo2D) for EngineeringCRS? In that case, I can make a PR for that.

@rouault
Copy link
Member

rouault commented Sep 11, 2022

Does it make sense to do the same (promoteTo3D and demoteTo2D) for EngineeringCRS?

maybe... ? But I don't see a strong need to add that, at least now. PROJ cannot do much with EngineeringCRS apart import/export from/into WKT/PROJJSON, so I don't see a pressing need for adding those methods, whose main usefulness is for createOperations() purposes.

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.

2 participants