This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Pipeline de Super-Resolução Multi-GPU para servidor Linux. | |
| Processa múltiplos rasters em paralelo, um por GPU. | |
| Fluxo por raster: | |
| GeoTIFF → numpy (RAM) → tiles → GPU (batches) → mosaico → GeoTIFF | |
| Uso: | |
| # Processar um raster (usa GPU 0 por padrão) | |
| python pipeline_sr_multigpu.py -opt config_server.yml \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from abc import ABC, abstractmethod | |
| from typing import List | |
| from dataclasses import MISSING, dataclass, field | |
| import os | |
| from qgis import processing | |
| from qgis.PyQt.Qt import QVariant | |
| from qgis.PyQt.QtCore import QCoreApplication | |
| from qgis.core import (QgsProcessing, QgsVectorFileWriter, QgsProcessingAlgorithm, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| /*************************************************************************** | |
| DsgTools | |
| A QGIS plugin | |
| Brazilian Army Cartographic Production Tools | |
| ------------------- | |
| begin : 2025-07-17 | |
| git sha : $Format:%H$ | |
| copyright : (C) 2025 by Philipe Borba - Cartographic Engineer @ Brazilian Army |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Stack e reprojeção de imagens Sentinel-2 TCI para Super Resolution. | |
| Replica o model_sem_corte do QGIS: | |
| 1. gdal_merge -separate (stack temporal como bandas) | |
| 2. gdalwarp para EPSG:3857, bilinear, pixel 9.555m | |
| """ | |
| from osgeo import gdal | |
| from pathlib import Path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ============================================================================ | |
| Label Line Extractor para QGIS | |
| --------------------------------------------------------------------------- | |
| Itera cada polígono de uma camada de referência, renderiza off-screen, | |
| e captura todos os rótulos de LINHA. Gera uma linha por rótulo com | |
| comprimento exato do texto, seguindo a geometria da feição original. | |
| - Labels "on line": linha coincide com a feição | |
| - Labels "above/below line": linha é deslocada (offset) à distância |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| ============================================================================ | |
| Label Bounds Extractor para QGIS – v4 CURVO + PRECISO | |
| --------------------------------------------------------------------------- | |
| Itera cada polígono de uma camada de referência, renderiza off-screen, | |
| e captura todos os rótulos. Extrai propriedades COMPLETAS do texto | |
| (fonte, tamanho, bold, itálico, buffer, espaçamentos, capitalização) | |
| para subdividir cada rótulo em retângulos por caractere com precisão. | |
| ★ v4: Suporte completo a rótulos CURVOS (Curved / PerimeterCurved) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from qgis.core import (QgsGeometry, QgsPointXY, QgsWkbTypes, QgsRasterLayer, | |
| QgsVectorLayer, QgsFeature, QgsProject, | |
| QgsCoordinateReferenceSystem, QgsField) | |
| from qgis import processing | |
| from qgis.utils import iface | |
| from PyQt5.QtCore import QVariant | |
| class RasterLabelPositioner: | |
| def __init__(self, moldura_geometry, polygon_individual, text_width_cells=5, text_height_cells=5): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| # ========================= | |
| # 📖 Exemplos de Uso | |
| # ========================= | |
| """ | |
| Combinador de PDFs para mapas | |
| - Combina múltiplos PDFs de página única em uma única página | |
| - Posicionamento preciso sem redimensionamento | |
| - Orientação horizontal e vertical (0° e 90°) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from qgis.core import QgsProject, QgsGeometry, QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsWkbTypes, QgsPointXY | |
| import os | |
| import zipfile | |
| import xml.dom.minidom as minidom | |
| import random | |
| import math | |
| def create_kmz_with_labels(layer_name, label_field, output_kmz_path, | |
| line_color='ff4aaf4d', line_width=4, | |
| label_color='ff00ff00', label_scale=1.5, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import glob | |
| import zipfile | |
| import math | |
| import shutil | |
| import argparse | |
| from concurrent.futures import ProcessPoolExecutor, as_completed | |
| from multiprocessing import cpu_count | |
| from tqdm import tqdm | |
| import time |
NewerOlder