Commit fb214fe1 authored by Andreas Hocevar's avatar Andreas Hocevar
Browse files

Re-add units to srs definition

Fixes a regression introduced with
5c64b033.
parent 1303457c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ module.exports = function(defData) {
      self.to_meter = parseFloat(v);
    },
    units: function(v) {
      self.units = v;
      if (units[v]) {
        self.to_meter = units[v].to_meter;
      }
+7 −1
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@ function startTests(chai, proj4, testPoints) {
  ]);
  proj4.defs('esriOnline', 'PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]');

  describe('parse', function() {
    it('should parse units', function() {
      assert.equal(proj4.defs('testmerc2').units, 'm');
    });
  });

  describe('proj2proj', function() {
    it('should work transforming from one projection to another', function() {
      var sweref99tm = '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs';