Skip to content

Instantly share code, notes, and snippets.

@vicentereig
Created March 28, 2012 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicentereig/2224990 to your computer and use it in GitHub Desktop.
Save vicentereig/2224990 to your computer and use it in GitHub Desktop.
EPSG:25831 to latlon
# To get this gist running use Ruby 1.9.2 or greater and:
# brew install proj
# gem install proj4rb
#
# http://spatialreference.org/ref/epsg/25831/
require 'proj4'
utm_point = Proj4::Point.new(43718.773, 72605.572)
utm30 = Proj4::Projection.new(proj: "utm", zone: "30", units: "m", ellps: 'intl')
latlon = utm30.inverse(utm_point) # #<Proj4::Point:0x007fc6bcc1be18 @x=-0.12386724340102136, @y=0.01143503092427857, @z=0>
# In fact, these are the coordinates returned by http://camaras.valencia.es:
# #<CamarasValenciaEs::SurveillancePost:0x007fcb5c4307e0 @id="001", @x=4371877.3, @y=726045.72, @icon_type="1">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment