Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
names = []
format = 'GTiff'
out_file = 'out.tif'
ulx = None
psize_x = None
separate = 0
copy_pct = 0
nodata = None
create_options = []
pre_init = None
band_type = None
createonly = 0
gdal.AllRegister()
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-o':
i = i + 1
out_file = argv[i]
elif arg == '-v':
verbose = 1
elif arg == '-createonly':
# =============================================================================
#
# Program mainline.
#
if __name__ == '__main__':
names = []
out_file = 'out.vrt'
ulx = None
psize_x = None
separate = False
pre_init = None
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-o':
i = i + 1
out_file = argv[i]
elif arg == '-separate':
separate = True
elif arg == '-ul_lr':
def gdal_edit(argv):
argv = gdal.GeneralCmdLineProcessor( argv )
if argv is None:
return -1
datasetname = None
maskname = None
outputname = None
srs = None
ulx = None
uly = None
lrx = None
lry = None
nodata = None
xres = None
yres = None
unsetgt = False
molist = []
def Usage():
print 'Usage: rgb2pct.py [-n colors] [-of format] source_file dest_file'
sys.exit(1)
# =============================================================================
# Mainline
# =============================================================================
color_count = 256
format = 'GTiff'
src_filename = None
dst_filename = None
gdal.AllRegister()
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-of':
i = i + 1
format = argv[i]
elif arg == '-n':
i = i + 1
color_count = int(argv[i])
# =============================================================================
#
# Program mainline.
#
if __name__ == '__main__':
srcwin = None
skip = 1
srcfile = None
dstfile = None
band_num = 1
gdal.AllRegister()
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-srcwin':
srcwin = (int(argv[i+1]),int(argv[i+2]),
int(argv[i+3]),int(argv[i+4]))
i = i + 4
elif arg == '-skip':
skip = int(argv[i+1])
i = i + 1
def Usage():
print 'Usage: gcp2vec.py [-of ] '
sys.exit(1)
# =============================================================================
# Mainline
# =============================================================================
format = 'GML'
in_file = None
out_file = None
pixel_out = 0
gdal.AllRegister()
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-of':
format = argv[i]
if arg == '-p':
pixel_out = 1
elif in_file is None:
in_file = argv[i]
def Usage():
print 'Usage: pct2rgb.py [-of format] [-b ] source_file dest_file'
sys.exit(1)
# =============================================================================
# Mainline
# =============================================================================
format = 'GTiff'
src_filename = None
dst_filename = None
out_bands = 3
band_number = 1
gdal.AllRegister()
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv is None:
sys.exit( 0 )
# Parse command line arguments.
i = 1
while i < len(argv):
arg = argv[i]
if arg == '-of':
i = i + 1
format = argv[i]
elif arg == '-b':
i = i + 1
band_number = int(argv[i])
<div id="subheader">Generated by <a href="http://www.maptiler.org/">MapTiler</a>/<a href="http://www.klokan.cz/projects/gdal2tiles/">GDAL2Tiles</a>, Copyright © 2008 <a href="http://www.klokan.cz/">Klokan Petr Pridal</a>, <a href="http://www.gdal.org/">GDAL</a> & <a href="http://www.osgeo.org/">OSGeo</a> <a href="http://code.google.com/soc/">GSoC</a>
</div>
<div id="map"></div>
""" % args
return s
# =============================================================================
# =============================================================================
# =============================================================================
if __name__=='__main__':
argv = gdal.GeneralCmdLineProcessor( sys.argv )
if argv:
gdal2tiles = GDAL2Tiles( argv[1:] )
gdal2tiles.process()
<div id="map"></div>
""" \
% args
return s
# =============================================================================
# =============================================================================
# =============================================================================
if __name__ == '__main__':
argv = gdal.GeneralCmdLineProcessor(sys.argv)
if argv:
gdal2tiles = GDAL2Tiles(argv[1:])
gdal2tiles.process()