Changeset a8dd8b9 in tol


Ignore:
Timestamp:
Jan 2, 2010, 4:16:42 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7618682
Parents:
d0fc203
Message:

UTM zone have latitud and longitud components and both are passed as matrices to encoding-decoding functions

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1899 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_pkg/GisTools/GisTools.tol

    rd0fc203 ra8dd8b9  
    6767
    6868  ////////////////////////////////////////////////////////////////////////////
    69   Real initialice(Real void)
     69  Real initialize(Real void)
    7070  ////////////////////////////////////////////////////////////////////////////
    7171  {
    … …  
    119119      Real _.b = b
    120120    ]];
    121     Real aux::initialice(?);
     121    Real aux::initialize(?);
    122122    Eval(name+"=aux")
    123123  };
    … …  
    189189    VMatrix lonlat, //Matrix with two columns, first one is longitud, second
    190190                    //one is latitude, both meassured in in radians
    191     Real zone) //UTM zone
     191    VMatrix lonZone) //UTM longitud zone
    192192  ////////////////////////////////////////////////////////////////////////////
    193193  {
    194194    //Central meridian of zone
    195     Real long0 = (6*zone-183)*deg2rad;
     195    VMatrix long0 = (lonZone*6-183)*deg2rad;
    196196    //longitude of points
    197     VMatrix long = ASin(Sin(SubCol(lonlat,[[1]])));
     197    VMatrix long = SubCol(lonlat,[[1]]);
    198198    //latitude of points
    199     VMatrix lat = ASin(Sin(SubCol(lonlat,[[2]])));
     199    VMatrix lat = SubCol(lonlat,[[2]]);
    200200    Real e2 = _.e^2;
    201201    VMatrix e2sinlat2_1 = -(Sin(lat)^2)*e2+1;
    … …  
    247247    VMatrix lonlat, //Matrix with two columns, first one is longitud, second
    248248                    //one is latitude, both meassured in degrees
    249     Real zone) //UTM zone
    250   ////////////////////////////////////////////////////////////////////////////
    251   {
    252     rad2utm(lonlat*deg2rad,zone)
     249    VMatrix lonZone) //UTM longitud zone
     250  ////////////////////////////////////////////////////////////////////////////
     251  {
     252    rad2utm(lonlat*deg2rad,lonZone)
    253253  };
    254254
    … …  
    258258  VMatrix utm2rad(
    259259    VMatrix xy, //Matrix with two columns
    260     Real zone) //UTM zone
    261   ////////////////////////////////////////////////////////////////////////////
    262   {
     260    VMatrix lonZone, //UTM longitud zone
     261    VMatrix latZone) //UTM latitud zone
     262  ////////////////////////////////////////////////////////////////////////////
     263  {
     264  //WriteLn("TRACE zone="<<zone);
    263265    //Central meridian of zone
    264     Real long0 = (6*zone-183)*deg2rad;
     266    VMatrix long0 = (lonZone*6-183)*deg2rad;
     267  //WriteLn("TRACE long0="<<long0);
    265268    //easting of points
    266269    VMatrix x = SubCol(xy,[[1]])-500000;
    267270    //northing of points
    268     VMatrix y = SubCol(xy,[[2]]);
     271    VMatrix isSouthern = LT(latZone,latZone*0);
     272    VMatrix y =
     273    {
     274      VMatrix aux = SubCol(xy,[[2]]);
     275      IfVMat(isSouthern,-aux+1.E+7,aux)
     276    };
    269277    Real e2 = _.e^2;
    270278    Real e4 = _.e^4;
    … …  
    287295    VMatrix sinfp = Sin(fp);
    288296    VMatrix cosfp = Cos(fp);
    289     VMatrix tanfp = sinfp$/cosfp;
     297    VMatrix tanfp = Tan(fp);
    290298    VMatrix C1 = (cosfp^2)*_.e.2;
    291299  //WriteLn("TRACE C1="<<VMat2Mat(C1));
    … …  
    317325    VMatrix long = (Q5 - Q6 + Q7)$/cosfp+long0;
    318326  //WriteLn("TRACE long="<<VMat2Mat(long));
    319     long | lat
     327    long | IfVMat(isSouthern,-lat,lat)
    320328  };
    321329  ////////////////////////////////////////////////////////////////////////////
    … …  
    324332  VMatrix utm2deg(
    325333    VMatrix xy, //Matrix with two columns
    326     Real zone) //UTM zone
    327   ////////////////////////////////////////////////////////////////////////////
    328   {
    329     utm2rad(xy,zone)/deg2rad
     334    VMatrix lonZone, //UTM longitud zone
     335    VMatrix latZone) //UTM latitud zone
     336  ////////////////////////////////////////////////////////////////////////////
     337  {
     338    utm2rad(xy,lonZone,latZone)/deg2rad
    330339  }
    331340};
    … …  
    643652
    644653
     654
     655
Note: See TracChangeset for help on using the changeset viewer.