Changeset 27530


Ignore:
Timestamp:
01/19/23 05:47:30 (2 years ago)
Author:
bdef
Message:

CHG:moving from gdal to projinfo,

Location:
issm/trunk-jpl/src/m
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/sealevelmodel.py

    r27458 r27530  
    241241            self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force))
    242242
    243             self.earth.solidearth.transfercount[self.transitions[i]] = self.earth.solidearth/transfercount[self.transitions[i]] + 1
     243            self.earth.solidearth.transfercount[self.transitions[i]] = self.earth.solidearth.transfercount[self.transitions[i]] + 1
    244244
    245245        for i in range(len(self.icecaps)):
  • issm/trunk-jpl/src/m/coordsystems/epsg2proj.py

    r27523 r27530  
    2020
    2121    #First, get GDAL version
    22     subproc_args = "gdalsrsinfo --version | awk '{print $2}' | cut -d '.' -f1"
    23     subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
    24     outs, errs = subproc.communicate()
    25     outs = outs.decode()
    26     errs = errs.decode()
    27     print(errs != '', errs == '', errs)
    28     if errs != '':
    29         raise RuntimeError("epsg2proj: call to gdalsrsinfo failed: {}".format(errs))
    30 
    31     version_major = int(outs)
    32 
    33     subproc_args = "gdalsrsinfo epsg:{} | command grep PROJ.4 | tr -d '\n' | sed 's/PROJ.4 : //'".format(epsg)
     22    #subproc_args = "gdalsrsinfo --version | awk '{print $2}' | cut -d '.' -f1"
     23    subproc_args = "projinfo -o PROJ -q epsg:{}".format(epsg)
    3424    subproc = subprocess.Popen(subproc_args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
    3525    outs, errs = subproc.communicate()
    3626    if errs != '':
    37         raise RuntimeError("epsg2proj: call to gdalsrsinfo failed: {}".format(errs))
    38 
    39     if version_major == 1:
    40         outs = outs[1:-1]
     27        raise RuntimeError("epsg2proj: call to projinfo failed: {}".format(errs))
    4128
    4229    return outs
Note: See TracChangeset for help on using the changeset viewer.