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

Operation: Convert co-ordinate format #476

Merged
merged 15 commits into from
Jan 18, 2019
Merged

Conversation

j433866
Copy link
Member

@j433866 j433866 commented Jan 17, 2019

Adds a new operation to convert between geographical co-ordinate formats / projections (requested in #228 ).

It currently supports converting to/from:

  • Degrees Minutes Seconds
  • Degrees Decimal Minutes
  • Decimal Degrees
  • Geohash (Replaces the To/From Geohash operations)
  • Military Grid Reference System
  • Ordnance Survey National Grid
  • Universal Transverse Mercator (UTM)

In the future, more formats / projections could be added, and I'm working on getting an operation working to display co-ordinates on a map.

@j433866 j433866 mentioned this pull request Jan 18, 2019
@n1474335 n1474335 merged commit 4bd923d into gchq:master Jan 18, 2019
@n1474335
Copy link
Member

Excellent work again.

I've changed a few large if/else chains to switch statements. JavaScript supports switch statements on strings, unlike Python, so I prefer to use them when there are a reasonable number of cases as it makes the code a little more readable.

I'd also recommend you take a look at ternary conditionals as they can reduce the need for so many nested if statements. It's always a balance between making the code a bit more compact but keeping it readable. I think in these cases, ternary statements are just as readable and help to reduce the brace armageddon!

This pull request was closed.
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