def initAsGSISSHWrapper(self, logger, hostname, port=22, username='', password='', x509_userproxy=None): if which('gsissh') == None: raise CommandWrapperException("Couldn't find Globus 'gsissh' executable in path") cw = CommandWrapper(logger) cw._mode = 'gsissh' cw.hostname = hostname cw.port = port cw.username = username cw.password = password cw.x509_userproxy = x509_userproxy cw._is_connected = False return cw
def initAsSSHWrapper(self, logger, hostname, port=22, username='', password='', userkey=''): if which('ssh') == None: raise CommandWrapperException("Couldn't find 'ssh' executable in path") cw = CommandWrapper(logger) cw._mode = 'ssh' cw.hostname = hostname cw.port = port cw.username = username cw.password = password cw.userkey = userkey cw._is_connected = False return cw
def initAsGSISSHWrapper(self, logger, hostname, port=22, username='', password='', x509_userproxy=None): if which('gsissh') == None: raise CommandWrapperException( "Couldn't find Globus 'gsissh' executable in path") cw = CommandWrapper(logger) cw._mode = 'gsissh' cw.hostname = hostname cw.port = port cw.username = username cw.password = password cw.x509_userproxy = x509_userproxy cw._is_connected = False return cw
def initAsSSHWrapper(self, logger, hostname, port=22, username='', password='', userkey=''): if which('ssh') == None: raise CommandWrapperException( "Couldn't find 'ssh' executable in path") cw = CommandWrapper(logger) cw._mode = 'ssh' cw.hostname = hostname cw.port = port cw.username = username cw.password = password cw.userkey = userkey cw._is_connected = False return cw
import config from osgeo import gdal from osgeo import osr from osgeo import ogr from osgeo import gdal_array from osgeo import gdalconst import numpy import scipy version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) err = which("convert") if err == None: print "convert missing" sys.exit(-1) err = which("bzip2") if err == None: print "bzip2 missing" sys.exit(-1) err = which("potrace") if err == None: print "potrace missing" sys.exit(-1) err = which("topojson")
cmd = "subset.py " + base_img + " " + in_img + " " + out_img print cmd os.system(cmd) # # Main # if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) # make sure we have ImageMagick convert err = which("convert") if err == None: print "convert missing" sys.exit(-1) # make sure that mapnik as the gdal plugin if not 'gdal' in c.plugin_names(): print "Missing 'gdal' input plugin in mapnik" sys.exit(-1) # make sure tiff delegate is present output = subprocess.check_output("convert --version | grep Delegates", shell=True) err = output.find('tiff') if err == -1: print "ImageMagick Convert does not have a tiff delegate... rebuild it!", output
cmd = str.format("topojson -o {0} -- reference_water={1} ", osm_surface_water_topojson, osm_surface_water_geojson); self.execute(cmd) cmd = "rm "+osm_surface_water_pgm self.execute(cmd) # Main # modis.py -y 2013 -d 205 -t 020E010S -p 2 -v if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) err = which("convert") if err == None: print "convert missing... brew install imagemagick --with-libtiff" sys.exit(-1) err = which("gdal_translate") if err == None: print "gdal_translate missing... install gdal" sys.exit(-1) err = which("potrace") if err == None: print "potrace missing" sys.exit(-1) err = which("node")
self.execute(cmd) cmd = str.format("gzip {0} ", self.surface_water_json ); self.execute(cmd) # # Example: landsat8_to_topojson.py --input /Volumes/proddata/landsat8_ds/LWD_Haiti_L8_009046_2013357_FLAASH_Red.tif --dir /Volumes/proddata/landsat8_l2/LWD_Haiti_L8_009046_2013357 --vrt all_hand.vrt # if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) err = which("convert") if err == None: print "convert missing" sys.exit(-1) err = which("bzip2") if err == None: print "bzip2 missing" sys.exit(-1) err = which("potrace") if err == None: print "potrace missing" sys.exit(-1) err = which("topojson")
self.execute(cmd) cmd = "rm " + osm_surface_water_pgm self.execute(cmd) # Main # modis.py -y 2013 -d 205 -t 020E010S -p 2 -v if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) err = which("convert") if err == None: print "convert missing... brew install imagemagick --with-libtiff" sys.exit(-1) err = which("gdal_translate") if err == None: print "gdal_translate missing... install gdal" sys.exit(-1) err = which("potrace") if err == None: print "potrace missing" sys.exit(-1) err = which("node")
# De-speckle data = scipy.signal.medfilt2d(data, kernel_size=3) gdal_array.SaveArray(data.astype(numpy.int8), slope2, prototype=gdal.Open(slope)) print "saved water from dem", slope2 # # Main # if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) # make sure we have ImageMagick convert err = which("convert") if err == None: print "convert missing" sys.exit(-1) # make sure that mapnik as the gdal plugin if not 'gdal' in c.plugin_names(): print "Missing 'gdal' input plugin in mapnik" sys.exit(-1) # make sure tiff delegate is present output = subprocess.check_output("convert --version | grep Delegates", shell=True) err = output.find('tiff') if err==-1: print "ImageMagick Convert does not have a tiff delegate... rebuild it!", output sys.exit(-1)
cmd = str.format("gdal_translate -of PNG -outsize 20% 20% {0} {1}", self.input_jpg_file, self.browse_file) else: cmd = str.format("gdal_translate -of PNG -outsize 20% 20% {0} {1}", self.input_file, self.browse_file) self.execute(cmd) # # dfo_watermap.py -v --scene 2014Bangladesh4178 # if __name__ == '__main__': version_num = int(gdal.VersionInfo('VERSION_NUM')) if version_num < 1800: # because of GetGeoTransform(can_return_null) print('ERROR: Python bindings of GDAL 1.8.0 or later required') sys.exit(1) err = which("tar") if err == None: print "tar missing" sys.exit(-1) err = which("potrace") if err == None: print "potrace missing" sys.exit(-1) err = which("topojson") if err == None: print "topojson missing" sys.exit(-1) err = which("gzip")