CH1903 WGS84 Conversion
Last update: 23. February 2011, 14:45
Here the signatures of the single functions:
/* * CH1903 <=> WGS84 Approx * * Implementation of the approximative conversion function * of the federal swiss topological institute. * © nico waldispuehl 08 * * Results are sufficiently precise on the area of switzerland. */ /* * Double toSexagesimalSec(Double x) * * Transforms a value from degrees to sexagesimalsecs. * Takes a double value as input and returns a double value. * * Is used as a helper function for the conversion functions */ /* * Array(Double, Double) swissGridToCoords(Integer y, Integer x) * * Transforms a coordinate from the swiss grid system to * actual world coordinates in longitude and latitude. * * Takes two integers as input. Returns an array of doubles. * * Note that the names of the input arguments are misleading * because of a inconsistency of the swiss grid with a common * coordinate system; y is the longitudial part (from right) and * x is the latitudial part (from bottom). * * Use the usual form to input the data; to convert a swiss grid * coordinate of let’s say 600000/200000 use the function as follows: * * var result = swissGridToCoords(600000, 200000); * * result contains now: 46.951081, 7.438637 */ /* * Array(Integer, Integer) coordsToSwissGrid(Double lat, Double lng) * * Transforms a coordinate from the world coordinate system to * the swiss grid coordinate system. * * Takes the doubles latitude and longitude as input and returns * an array of two integers as output. * * var result = coordsToSwissGrid(46.951081, 7.438637); * * result now contains 600000, 200000 * */
Download: latlng_coord_approx.js



