1:45 PM 11/12/2025 ���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!
Warning: Undefined variable $authorization in C:\xampp\htdocs\demo\fi.php on line 57

Warning: Undefined variable $translation in C:\xampp\htdocs\demo\fi.php on line 118

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\demo\fi.php on line 119

Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\demo\fi.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 248

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 249

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 250

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 251

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 252
#!/usr/bin/env python3 """ v1.0.4 20201118 Yu Morishita, GSI ======== Overview ======== This script generates directory with TMS tiles using gdal2tiles.py. https://gdal.org/programs/gdal2tiles.html ===== Usage ===== LiCSBAS_color_geotiff2tiles.py -i infile [-o outdir] [--zmin int] [--zmax int] [--xyz] [--n_para int] -i Input color GeoTIFF file -o Output directory containing XYZ tiles (Default: tiles_[infile%.tif], '.' will be replaced with '_') --title Title of the map (Default: outdir) --zmin Minimum zoom level to render (Default: 5) --zmax Maximum zoom level to render (Default: auto, see below) 17 (pixel spacing <= 5m) 16 (pixel spacing <= 10m) 15 (pixel spacing <= 20m) 14 (pixel spacing <= 40m) 13 (pixel spacing <= 80m) 12 (pixel spacing <= 160m) 11 (pixel spacing > 160m) --xyz Output XYZ tiles instead of TMS (opposite Y) --n_para Number of parallel processing (Default: # of usable CPU) Available only in gdal>=2.3 """ #%% Change log ''' v1.0.4 20201118 Yu Morishita, GSI - Again Bug fix of multiprocessing v1.0.3 20201116 Yu Morishita, GSI - Bug fix of multiprocessing in Mac python>=3.8 v1.0.2 20201028 Yu Morishita, GSI - Update how to get n_para v1.0.1 20201016 Yu Morishita, GSI - Change default output name v1.0 20200924 Yu Morishita, GSI - Original implementation ''' #%% Import import getopt import os import sys import time import shutil import glob from osgeo import gdal import numpy as np import subprocess as subp import multiprocessing as multi class Usage(Exception): """Usage context manager""" def __init__(self, msg): self.msg = msg #%% Main def main(argv=None): #%% Check argv if argv == None: argv = sys.argv start = time.time() ver='1.0.4'; date=20201118; author="Y. Morishita" print("\n{} ver{} {} {}".format(os.path.basename(argv[0]), ver, date, author), flush=True) print("{} {}".format(os.path.basename(argv[0]), ' '.join(argv[1:])), flush=True) ### For paralell processing global files #%% Set default infile = [] outdir = [] zmin = 5 zmax = [] tms_flag = True add_gsi = True title = '' try: n_para = len(os.sched_getaffinity(0)) except: n_para = multi.cpu_count() import win_compat; q = win_compat.get_compatible_context() #%% Read options try: try: opts, args = getopt.getopt(argv[1:], "hi:o:", ["help", "zmin=", "title=", "zmax=", "xyz", "n_para="]) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o == '-h' or o == '--help': print(__doc__) return 0 elif o == '-i': infile = a elif o == '--title': title = a elif o == '-o': outdir = a elif o == '--zmin': zmin = int(a) elif o == '--zmax': zmax = int(a) elif o == '--xyz': tms_flag = False elif o == '--n_para': n_para = int(a) if not infile: raise Usage('No input file given, -i is not optional!') elif not os.path.exists(infile): raise Usage('No {} exists!'.format(infile)) elif gdal.Open(infile) is None: raise Usage('{} is not GeoTIFF!'.format(infile)) except Usage as err: print("\nERROR:", file=sys.stderr, end='') print(" "+str(err.msg), file=sys.stderr) print("\nFor help, use -h or --help.\n", file=sys.stderr) return 2 #%% Parameter setting if not outdir: outdir = 'tiles_'+infile.replace('.tif', '').replace('.', '_') if os.path.exists(outdir): print('\n{} already exists. Remove and overwrite.'.format(outdir), flush=True) shutil.rmtree(outdir) print('\nOutput dir: {}'.format(outdir), flush=True) if not title: title = outdir if not zmax: geotiff = gdal.Open(infile) lon_w, dlon, _, lat_n, _, dlat = geotiff.GetGeoTransform() ### Approx pixel spacing in meter dlat_m = abs(dlat*40000000/360) ## deg -> meter dlon_m = abs(dlon*40000000/360*np.cos(np.deg2rad(lat_n))) ## deg -> meter pixsp = dlat_m if dlat_m < dlon_m else dlon_m ## Use smaller one #if pixsp <= 5: zmax = 17 #elif pixsp <= 10: zmax = 16 #elif pixsp <= 20: zmax = 15 #elif pixsp <= 40: zmax = 14 #elif pixsp <= 80: zmax = 13 #elif pixsp <= 160: zmax = 12 #else: zmax = 11 # ML: better way?: zmax = np.log2(156543 / pixsp) zmax = round(min(20, zmax))+2 print('\nZoom levels: {} - {}'.format(zmin, zmax), flush=True) gdalver = gdal.VersionInfo() ## e.g., 3.1.1 -> 3010100, str #%% gdal2tiles call = ["gdal2tiles.py", "-z", "{}-{}".format(zmin, zmax), "--no-kml", "-w", "leaflet", "-r", "med", "-t", title, infile, outdir] if int(gdalver[0]) >= 3: ## -x option (Exclude transparent tiles) available in ver>=3 call.insert(1, "-x") if int(gdalver[0:3]) >= 203: ## --processes option available in ver>=2.3 call.insert(1, "--processes={}".format(n_para)) if not tms_flag and int(gdalver[0:3]) >= 301: ## --xyz option available ver>=3.1 call.insert(1, "--xyz") print('', flush=True) print(' '.join(call), flush=True) p = subp.Popen(call, stdout = subp.PIPE, stderr = subp.STDOUT) for line in iter(p.stdout.readline, b''): print(line.rstrip().decode("utf8"), flush=True) #%% Remove transparent tiles if gdal<3 if int(gdalver[0]) <3: print('\nRemove transparent tiles...', flush=True) call = ["find", outdir, "-size", "334c", "|", "xargs", "rm", "-f"] subp.run(' '.join(call), shell=True) #%% Invert y if XYZ tiles and gdal<3.1 if not tms_flag and int(gdalver[0:3]) < 301: print('\nInvert Y with {} parallel processing...'.format(n_para), flush=True) files = glob.glob('{}/*/*/*.png'.format(outdir)) p = q.Pool(n_para) p.map(invert_y_wrapper, range(len(files))) p.close() #%% Edit leaflet.html with open(os.path.join(outdir, 'leaflet.html'), 'r') as f: lines = f.readlines() if add_gsi: ### Add GSImaps gsi = ' // .. GSIMaps\n var gsi = L.tileLayer(\'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png\', {attribution: \'地理院タイル\'});\n' gsi2 = '"GSIMaps": gsi, ' gsi_photo = ' // .. GSIMaps photo\n var gsi_photo = L.tileLayer(\'https://cyberjapandata.gsi.go.jp/xyz/seamlessphoto/{z}/{x}/{y}.jpg\', {attribution: \'地理院タイル\'});\n' gsi_photo2 = '"GSIMaps Photo": gsi_photo, ' ### XYZ or TMS tms = 'true' if tms_flag else 'false' ### Replace lines2 = [s+gsi+gsi_photo if '// Base layers\n' in s else s.replace('= {', '= {'+gsi2+gsi_photo2) if 'var basemaps =' in s else s.replace('true', tms) if 'tms: true' in s else s for s in lines] with open(os.path.join(outdir, 'leaflet2.html'), 'w') as f: f.writelines(lines2) #%% Create layers.txt for GSIMaps # url = 'file://' + os.path.join(os.path.abspath(outdir), '{z}', '{x}', '{y}.png') url = os.path.join('http://', 'XXX', outdir, '{z}', '{x}', '{y}.png') with open(os.path.join(outdir, 'layers.txt'), 'w') as f: f.writelines(layers_txt(outdir, url, zmin, zmax, tms)) #%% Finish elapsed_time = time.time()-start hour = int(elapsed_time/3600) minite = int(np.mod((elapsed_time/60),60)) sec = int(np.mod(elapsed_time,60)) print("\nElapsed time: {0:02}h {1:02}m {2:02}s".format(hour,minite,sec)) print('\n{} Successfully finished!!\n'.format(os.path.basename(argv[0]))) print('Output: {}'.format(outdir), flush=True) print('') #%% def invert_y_wrapper(i): file = files[i] if np.mod(i, 1000) == 0: print(" {0:5}/{1:5}th file...".format(i, len(files)), flush=True) d, z, x, ypng = file.split('/') y = os.path.splitext(ypng)[0] y_new = str(2**int(z)-int(y)-1) file_new = os.path.join(d, z, x, y_new+'.png') os.rename(file, file_new) #%% def layers_txt(outdir, url, zmin, zmax, tms): layerstxt = \ '{{\n\ "layers": [\n\ {{\n\ "type": "LayerGroup",\n\ "title": "",\n\ "entries": [\n\ {{\n\ "type": "Layer",\n\ "id": "",\n\ "title": "{}",\n\ "iconUrl": "",\n\ "url": "{}",\n\ "subdomains": "",\n\ "attribution": "",\n\ "errorTileUrl": "",\n\ "cocotile": false,\n\ "minZoom": {},\n\ "maxZoom": 18,\n\ "maxNativeZoom": {},\n\ "tms": {},\n\ "legendUrl": "",\n\ "html": ""\n\ }}\n\ ]\n\ }}\n\ ]\n\ }}\n'.format(outdir, url, zmin, zmax, tms) return layerstxt #%% main if __name__ == "__main__": sys.exit(main())