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

Fix UTM, LCC, Krovak and Stere projections #71

Merged
merged 6 commits into from
Apr 12, 2021
Merged

Fix UTM, LCC, Krovak and Stere projections #71

merged 6 commits into from
Apr 12, 2021

Conversation

pomadchin
Copy link
Member

@pomadchin pomadchin commented Apr 6, 2021

Summary

  • Fix UTM projection (it is backed by etmerc now, made tests much better (!))
  • Fix tests
  • Resurrect proj4-epsg tests and update them up to date

Test resurrection results

Before this PR proj4-epsg.csv contained the following amount of tests:

  • passing: 2899
  • failing: 1089
  • error: 292

After:

  • passing: 3941 (893 tests were fixed due to the ExtendedTransverseMercatorProjection)
  • failing: 195
  • error: 144 (geocent projection is supported now)

UPD

After (with LCC projection fix):

  • passing: 4098
  • failing: 38
  • error: 144

UPD2

After (with Krovak projection fix):

  • passing: 4104
  • failing: 34
  • error: 144

Closes #25
Closes #58
Closes #61

@@ -100,6 +100,66 @@ public void testExplicitTransform() {
assertTrue(isInTolerance(p2, 33, 42, 0.000001));
}

@Test
public void lccToUtmBidirectionalTransform() {
Copy link
Member Author

@pomadchin pomadchin Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This manual test was added, since it was the initial test case that led into this issue discovery.

Comment on lines +183 to +195
// this test is asjusted to match proj4s behavior
checkTransformAndInverse(
"EPSG:4326", -126.54, 54.15,
"EPSG:3005", 964813.103719, 1016486.305862,
0.0001, 0.2 * APPROX_METRE_IN_DEGREES);

checkTransformAndInverse(
"EPSG:32633", 249032.839239894, 7183612.30572229,
"EPSG:4326", 9.735465995810884, 64.68347938257097,
"EPSG:4326", 9.735465995870696, 64.68347938261206,
0.000001, 0.3 * APPROX_METRE_IN_DEGREES);

checkTransformAndInverse(
"EPSG:32636", 500000, 4649776.22482,
"EPSG:32636", 500000, 4649776.224819178,
Copy link
Member Author

@pomadchin pomadchin Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slighlty adjusted test, it matches Pro4JS behavior.

MetaCRSTestFileReader reader = new MetaCRSTestFileReader(file);
List<MetaCRSTestCase> tests = reader.readTests();
for (MetaCRSTestCase test : tests) {
Assert.assertTrue(runTest(test));
Copy link
Member Author

@pomadchin pomadchin Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, tests were not checking the exit code before this PR :D

register("urmfps", UrmaevFlatPolarSinusoidalProjection.class, "Urmaev Flat-Polar Sinusoidal");
register("utm", TransverseMercatorProjection.class, "Universal Transverse Mercator (UTM)");
register("utm", ExtendedTransverseMercatorProjection.class, "Universal Transverse Mercator (UTM)");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the UTM projection fix itself.

CHANGELOG.md Outdated Show resolved Hide resolved
@pomadchin pomadchin requested a review from echeipesh April 7, 2021 01:28
@pomadchin pomadchin changed the title Fix UTM projection Fix UTM and LCC projections Apr 7, 2021
@pomadchin pomadchin changed the title Fix UTM and LCC projections Fix UTM, LCC and Krovak projections Apr 8, 2021
@pomadchin pomadchin changed the title Fix UTM, LCC and Krovak projections Fix UTM, LCC, Krovak and Stere projections Apr 8, 2021
Copy link
Contributor

@echeipesh echeipesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tests done lie.
Note: added test cases came from Proj4JS

@pomadchin pomadchin merged commit 440f3e8 into locationtech:master Apr 12, 2021
@pomadchin pomadchin deleted the fix/utm branch April 12, 2021 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants