Tutoriais usados:
Instale a versão do php que estiver rodando no servidor, verifique a versão em http://localhost/dashboard/phpinfo.php
Tutoriais usados:
Instale a versão do php que estiver rodando no servidor, verifique a versão em http://localhost/dashboard/phpinfo.php
SELECT
'ALTER TABLE '|| table_name || ' RENAME TO ''' || replace(table_name, '2021', '2020') ||''';'
FROM gpkg_geometry_columns
WHERE table_name like '%2021';
Esse SQL vai buscar os nomes das tabelas em gpkg_geometry_columns
e criar o sql de renomeação para cada uma das tabelas que passarem no WHERE
.
with_variable('lyr_name', -- variável que vai pegar o nome do estado | |
aggregate( | |
layer:='lim_unidade_federacao_a', -- nome da camda do estado | |
aggregate:='min', | |
expression:="sigla", -- campo que quer usar para gerar o nome da camada | |
filter:=contains($geometry, geometry(@parent)) | |
), | |
with_variable('lyrmaps', -- vai receber o nome de todas as camadas no projeto | |
array_foreach(@layers, layer_property(@element, 'name')), --pega o nome de todas as camadas do projeto em uma lista | |
with_variable('lyrpos', array_find(@lyrmaps, upper(@lyr_name)), -- lirpos procura o nome da camada na lista e retorna a posicao, se nao encontrar retorna -1 |
O agendamento do crontab está da seguinte forma
*/15 * * * * cd /root/pasta_script; ./script.sh --cron
o script sh tem permissão para execução.....
Quando executo o arquivo .sh manualmente, o arquivo de log recebe todos os prints que o arquivo python gera, quando o script é executado
// adaptado de https://github.com/tryber/sd-05-live-lectures/blob/39.1/expressoes.py | |
const MATCHES = { | |
'}': '{', | |
']': '[', | |
')': '(', | |
'"': '"', | |
"'": "'", | |
"`": "`", | |
"```": "```" | |
}; |
-- Expression to be used at SELECT BY EXPRESSION AT LAYER A | |
array_contains( -- This will return true if the array contains the value | |
aggregate( -- will aggregate all values from target in to a string, using semicolons as concatenator | |
layer:='<table_b>', -- Target table containing the values, replace <table_b> whith your table name | |
aggregate:='array_agg', | |
expression:=to_string("<field_from_table_b>"), -- Field from table_b containing the values | |
), | |
"<field_table_a>") -- Field from table a with values to compare, replace <field_table_a> with your field name |
# Estados que queremos pegar os municípios
nomes = ['Minas Gerais', 'Paraíba', 'Espírito Santo', 'Goiás', 'Sergipe']
nomes = [f"'{nome}'" for nome in nomes]
# Pegando apenas as feições que precisamos
estados = QgsProject.instance().mapLayersByName('lim_unidade_federacao_a')[0]
subset_string = f"nome in ({','.join(nomes)})"
This is a issue using cross-layer filter provided by querylayer extension
LayerA - intersection_geom -> GEOMETRY, layer geometry;
LayerB - cd_bioma -> INTEGER, biome code; geom -> GEOMETRY, layer geometry;
intersects(intersection_geom, querySingle(layerB, 'geom', 'cd_bioma=1'))
# This script rename files using a csv list that contains | |
# img_Id, file_name, new_name, receiving_folder | |
# it will create all new folders needed to paste the copies | |
# And paste them inside the receiving_folder | |
# Created by Kyle Felipe | |
# kylefelipe at gmail.com | |
import os | |
import csv | |
from shutil import copy2 as copy |
Here is my issue:
I wish to delete all rows at row-group-view
if i delete a group from group
or if i delete a view
from view.