Repository navigation
Add Projection Equality - #45
Merged
Merged
Conversation
Without this CoordinateReferenceSystem is very fragile, sensative to name and formatting and order of projection parameters array.
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is follow-up PR to #33
Further testing revealed that
CoordinateReferenceSystemwas much too fragile because:CoordinateReferenceSystemname changes depending on how it was constructed. For instance name may beEPSG:3857if CRS was constructed by EPSG code ormerc-CSif it constructed from Proj4 string.+lat_0=0and+lat_0=0.0are obviously the same but will trip up equality+no_defis not present and thus will not be reflected in parameter string at allSo basically the situation is pretty dire and this PR attempts to remedy that.
It's worth noting that
Projectionclass is highly mutable which makes checking for equality a little tricky. While the mutability is used primarily by theProj4Parserto "build up" the projection its obviously possible that this is not the only place that mutation will happen because life.In this PR:
Projection.equalschecks that left and right side are the same class. This represents the implementation ofprojectmethod.Projection.equalschecks the state of protected and private stateful fields that have settersProjectioncheck equality of their additional stateful fields and delegate to super equality afterwards.isSouthandheightOfOrbitfields are moved to their corresponding subclasses. Getters and setters for those fields will throwNoSuchElementExceptionif used at any other time.Also ...
Closes: #38