This file has been truncated, but you can view the full file.
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
| SET standard_conforming_strings = OFF; | |
| BEGIN; | |
| INSERT INTO "public"."iniciativa" ("geom" , "nome_acao", "nome_comunidade", "localidade", "organizacao", "categoria", "uf", "municipio_cadastro", "origem", "premiado", "ano", "municipio_bbox_id", "organizacao_slug") VALUES ('0101000020E6100000C8073D9B553748C03D2CD49AE61DF5BF', 'O Direito Humano à leitura. Esse conceito foi protagonizado por Antônio Candido .Antônio Cândido foi um renomado crítico literário e escritor brasileiro que também tratou sobre a importância da leitura e da literatura na sociedade. Em seus ensaios e obras', 'Comunidades do Tenoné e no conjunto Satélite ', 'Travessa We 04, Tenoné, Belém - Pará, 66820-170, Brasil', 'REDE DE Bibliotecas Amazônia Literária/Rio de Leyras', 'Acesso à Justiça e Combate às Desigualdades', 'PA', 'Belém', 'redus', 'f', NULL, 4095, 'rede-de-bibliotecas-amazonia-literaria-rio-de-leyras'); | |
| INSERT INTO "public"."iniciativa" ("geom" , "nome_acao", "nome_comunidade", "localidade", "organizacao", "categoria", "uf", "municip |
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 geopandas as gpd | |
| import pandas as pd | |
| path = '/Users/marcellodebarrosfilho/Desktop/PAC/Reg_Tratada_08_05_2024.xlsx' | |
| gpkg = '/Users/marcellodebarrosfilho/code/curso_geopandas/dados/bc250_2021_11_18.gpkg' | |
| sedes = gpd.read_file(gpkg, layer='sedes') | |
| for idx, row in df.iterrows(): | |
| sede = sedes[(sedes['nome'].str.upper() == row['Município beneficiado']) & (sedes['sigla'] == row['UF'])] |
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 subprocess | |
| import geopandas as gpd | |
| from datetime import datetime | |
| # Diretório onde os arquivos estão localizados | |
| path = '/Users/marcellodebarrosfilho/Downloads/car_2024_rep' |
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 collections import defaultdict | |
| from osgeo import ogr | |
| from shapely.geometry import MultiLineString | |
| from shapely.wkt import loads | |
| ogr.UseExceptions() | |
| class Demanda: |
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
| def handle(self, *args, **options): | |
| val = options['município/estado/ano'] | |
| slug = slugify(val.split('/')[0]) | |
| sigla_uf = val.split('/')[1].strip().upper() | |
| ano = int(val.split('/')[2].strip()) | |
| municipio = Municipio.objects.get(slug=slug, sigla_uf=sigla_uf) | |
| SnciUsoOcupacao.objects.filter(snci__municipio=municipio.cod_ibge_m, ano=ano).delete() | |
| SigefUsoOcupacao.objects.filter(sigef__municipio=municipio.cod_ibge_m, ano=ano).delete() |
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
| def create_point(name): | |
| uri = "point?crs=epsg:4326" | |
| points = QgsVectorLayer(uri, name, 'memory') | |
| QgsProject.instance().addMapLayer(points) | |
| # chamando o provider para poder criar | |
| # tanto os campos, quanto validar todo o processo: | |
| provider = points.dataProvider() | |
| # definindo os campos da minha camada |
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
| <template> | |
| <div class="row"> | |
| <div class="col-md-6"> | |
| <canvas id="myChart"></canvas> | |
| </div> | |
| <div class="col-md-6"> | |
| <select class="form-select" v-model="year" v-on:change="getTotalByYear(year)"> | |
| <option selected>Escolha o ano</option> | |
| <option v-for="(year, index) in years" :key="index" :value="year">{{ year }}</option> | |
| </select> |
- Remover os caracteres especiais com interrogação do SIGEF:
Rode o comando:
shp2pgsql -W 'UTF-8' -s 4326 -t '2D' -a mapas_incrasigef2.shp mapas_incrasigef > mapas_incrasigef.sql
Ele vai quebrar uma linha antes do registro que possui o problema no campo nome_area. Abra o arquivo no SUBLIME e identifique a linha com problema, em seguida abra o QGIS. Entre em modo de edição e remova o caractere do registro.
- Mude o nome do campo
municipio_paramunicipio
- Correção do SRID para a tabela
adutoras_ce:
SELECT UpdateGeometrySRID('adutoras_ce','geom', 4674);The default SRID for geography is 4326. If you're new, I would suggest using geography instead of geometry