o AB¶dpã@s„ddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZe   ¡Zdd„Zdd„ZdS)éNcCs$| dd¡d}||g}| dd¡}t d|¡ d¡}t| d¡dƒd}|d}t| d¡dƒd} | d} dt|ƒd t|ƒd t| ƒd t| ƒd } d d i} dddœ} ||dddd| ddœ}| | ¡| | ¡| |¡t  |¡}t   |¡}|  ¡}|j }|j}|j}dS)NÚ.érú-z$[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]ièiÐz([ú,z],[z])Útypez filters.mergezfilters.expressionzClassification!=12)rÚ expressionú_nocolored.tifZClassificationÚmaxz writers.gdalgð?)ÚfilenameÚ dimensionÚ output_typerÚboundsÚ resolution)ÚrsplitÚsplitÚreÚsearchÚgroupÚintÚstrÚappendÚjsonÚdumpsÚpdalÚPipelineÚexecuteÚarraysÚmetadataÚlog)ÚorigenÚarchivoÚdestinoÚ nombrearchivoÚjsonDTMZarray_separadoÚ coordenadasÚxminÚxmaxÚymaxÚyminr ÚmergerÚwritersÚpeticionÚpipelineÚcountrrr©r.ú/FACIL_MAX_clasificacion_DAG.pyÚgeotiff_max_classif!s<  4ÿþ ú      r0c Cs<zätdttj ¡ƒddƒ}|t|ƒddkr'd}t|ƒ| |¡WdS|t|ƒddkr?d}t|ƒ| |¡WdSt |¡}d}|D]{}t   |d ¡sVt   |d ¡rÃd }zt |||ƒWnt yd }| |¡t|ƒt   ¡| t  ¡¡YqHw| d d¡d}tjd||dd|d||ddddtjd||dddd||d||d}| |¡qH|rÍtdƒWdSdtt ¡tƒd}| |¡| ¡WdSt ytdttj ¡ƒddƒ}t   ¡| t  ¡¡dtt ¡tƒd}| |¡| ¡YdSw)NZlog_geotiff_clasificacion_max_z.txtÚwrú/z2Path entrada mal especificado. Ha de acabar en "/"z4Path de salida mal especificado. Ha de acabar en "/"Tz*.lasz*.lazFz Error durante pdal rrzgdaldem color-relief rú z _colored.tifz -of GTiff)Úshellzrm u leído: z guardado: z _colored.tif z%No hay archivos las o laz que recibirz--- z seconds ---Z$log_error_geotiff_clasificacion_max_)ÚopenrÚdatetimeÚnowÚlenÚprintÚwriteÚosÚlistdirÚfnmatchr0Ú ExceptionÚ tracebackÚ print_excÚ format_excrÚ subprocessÚrunÚtimeÚ start_timeÚclose) rr!ÚtxtÚfilerÚarchivosZnohayr r"r.r.r/Úgeotiff_max_classif_coloreadoHs^     ú6 €  úrJ)ÚnumpyÚnpÚlaspyÚlprr;rrBr6r?rDr=ÚsysrÚcsvrEr0rJr.r.r.r/Ús   '