本文整理汇总了Python中osgeo.gdal.GeneralCmdLineProcessor方法的典型用法代码示例。如果您正苦于以下问题:Python gdal.GeneralCmdLineProcessor方法的具体用法?Python gdal.GeneralCmdLineProcessor怎么用?Python gdal.GeneralCmdLineProcessor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osgeo.gdal
的用法示例。
在下文中一共展示了gdal.GeneralCmdLineProcessor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from osgeo import gdal [as 别名]
# 或者: from osgeo.gdal import GeneralCmdLineProcessor [as 别名]
def main():
# TODO: gbataille - use mkdtemp to work in a temp directory
# TODO: gbataille - debug intermediate tiles.vrt not produced anymore?
# TODO: gbataille - Refactor generate overview tiles to not depend on self variables
argv = gdal.GeneralCmdLineProcessor(sys.argv)
input_file, output_folder, options = process_args(argv[1:])
nb_processes = options.nb_processes or 1
if nb_processes == 1:
single_threaded_tiling(input_file, output_folder, options)
else:
multi_threaded_tiling(input_file, output_folder, options)
示例2: main
# 需要导入模块: from osgeo import gdal [as 别名]
# 或者: from osgeo.gdal import GeneralCmdLineProcessor [as 别名]
def main(argv=None):
argv = gdal.GeneralCmdLineProcessor(sys_argv)
if argv:
gdal2tiles = GDAL2Tiles(argv[1:]) # handle command line options
print("Begin metadata generation complete.")
p = Process(target=worker_metadata, args=[argv])
p.start()
p.join()
print("Metadata generation complete.")
pool = Pool()
#processed_tiles = 0
print("Generating Base Tiles:")
for cpu in range(gdal2tiles.options.processes):
pool.apply_async(worker_base_tiles,
[argv, cpu],
callback=worker_callback)
pool.close()
# This progress code does not work. The queue deadlocks the pool.join() call.
#while len(active_children()) != 0:
# try:
# total = queue.get(timeout=1)
# processed_tiles += 1
# gdal.TermProgress_nocb(processed_tiles / float(total))
# stdout.flush()
# except:
# pass
pool.join()
print("Base tile generation complete.")
#processed_tiles = 0
tminz, tmaxz = getZooms(gdal2tiles)
print("Generating Overview Tiles:")
for tz in range(tmaxz - 1, tminz - 1, -1):
print("\tGenerating for zoom level: " + str(tz))
pool = Pool()
for cpu in range(gdal2tiles.options.processes):
pool.apply_async(worker_overview_tiles, [argv, cpu, tz])
pool.close()
#while len(active_children()) != 0:
# try:
# total = queue.get(timeout=1)
# processed_tiles += 1
# gdal.TermProgress_nocb(processed_tiles / float(total))
# stdout.flush()
# except:
# pass
pool.join()
print("\tZoom level " + str(tz) + " complete.")
print("Overview tile generation complete")