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
CoordinateReferenceSystem
was much too fragile because:CoordinateReferenceSystem
name changes depending on how it was constructed. For instance name may beEPSG:3857
if CRS was constructed by EPSG code ormerc-CS
if it constructed from Proj4 string.+lat_0=0
and+lat_0=0.0
are obviously the same but will trip up equality+no_def
is 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
Projection
class is highly mutable which makes checking for equality a little tricky. While the mutability is used primarily by theProj4Parser
to "build up" the projection its obviously possible that this is not the only place that mutation will happen because life.In this PR:
Projection.equals
checks that left and right side are the same class. This represents the implementation ofproject
method.Projection.equals
checks the state of protected and private stateful fields that have settersProjection
check equality of their additional stateful fields and delegate to super equality afterwards.isSouth
andheightOfOrbit
fields are moved to their corresponding subclasses. Getters and setters for those fields will throwNoSuchElementException
if used at any other time.Also ...
Closes: #38