geoutm icon indicating copy to clipboard operation
geoutm copied to clipboard

Specify zones with hemisphere instead of letter, fix spec and coords in 32V

Open zydeco opened this issue 10 years ago • 5 comments

  • Fix spec test data using Clarke 1866 ellipsoid, it wasn't passing since the radius was changed in 165c72d5ec4e1345d5a71c151ac5214cab26a04f
  • Fix converting LatLon coordinates in 32V zone to UTM (was returning negative easting)
  • Add ability to specify zones with + or - instead of a letter, for northern (+) and southern (-) hemisphere

zydeco avatar Oct 07 '14 16:10 zydeco

Are you sure this is correct?

tallakt avatar Oct 08 '14 18:10 tallakt

Yes, I checked the coordinates with several other sources:

  • MSP GeoTrans: http://earth-info.nga.mil/GandG/geotrans/
  • Jcoord: http://www.jstott.me.uk/jcoord/
  • UTM grid from Earth Point: http://www.earthpoint.us/Grids.aspx
  • coordinate-converter: https://github.com/kjbekkelund/coordinate-converter

it was previously returning wrong easting when converting LatLon coordinates in the 32V zone, due to using 15 degrees as the origin.

I made a test program to check the WGS-84 coordinates with Jcoord: https://gist.github.com/zydeco/59958820bb8c3a5e14ba

And another to test them all with coordinate-converter: https://gist.github.com/zydeco/6d8b19b31d7385b294e7

zydeco avatar Oct 08 '14 21:10 zydeco

Hi guys, this gem is amazing, thank you! Sorry if this is inappropriate, but please check this out:

[1] pry(main)> coordinate = GeoUtm::LatLon.new -22.34222, -41.76333 => #<GeoUtm::LatLon:0x007fffbf775990 @lat=-22.34222, @lon=-41.76333> [2] pry(main)> el = GeoUtm::Ellipsoid::lookup('International') => #<GeoUtm::Ellipsoid:0x007fffbb9146d8 @eccentricity=0.00672267, @name="International", @radius=6378388> [3] pry(main)> coordinate.to_utm(el) NoMethodError: undefined method []' for #<GeoUtm::Ellipsoid:0x007fffbb9146d8> from /home/unix/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/geoutm-1.0.2/lib/geoutm/utm.rb:28:in latlon_to_utm' [4] pry(main)> options = {:ellipsoid => el} => {:ellipsoid=>#<GeoUtm::Ellipsoid:0x007fffbb9146d8 @eccentricity=0.00672267, @name="International", @radius=6378388>} [5] pry(main)> coordinate.to_utm(options) => #<GeoUtm::UTM:0x007fffbda6f440 @e=215365.39252364816, @ellipsoid=#<GeoUtm::Ellipsoid:0x007fffbb9146d8 @eccentricity=0.00672267, @name="International", @radius=6378388>, @n=7526650.674066592, @zone="24K">

eliaszica avatar Dec 07 '16 17:12 eliaszica

Eliaszica: could you create a new issue for this. Thanks anyway

tallakt avatar Dec 07 '16 18:12 tallakt

@tallakt There is no way to create a new issue on this repo (except by making a pull request). Can you change this in the repo settings, or at least put something in the README about how to report issues?

marnen avatar Aug 27 '21 20:08 marnen