geoutm
geoutm copied to clipboard
Specify zones with hemisphere instead of letter, fix spec and coords in 32V
- 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
Are you sure this is correct?
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
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: could you create a new issue for this. Thanks anyway
@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?