This file contains 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; | |
CREATE TABLE "public"."teste" ( "ogc_fid" SERIAL, CONSTRAINT "teste_pk" PRIMARY KEY ("ogc_fid") ); | |
SELECT AddGeometryColumn('public','teste','geom',4326,'POINT',2); | |
CREATE INDEX "teste_geom_geom_idx" ON "public"."teste" USING GIST ("geom"); | |
ALTER TABLE "public"."teste" ADD COLUMN "id" NUMERIC(10,0); | |
ALTER TABLE "public"."teste" ADD COLUMN "nome" VARCHAR(255); | |
INSERT INTO "public"."teste" ("geom" , "id", "nome") VALUES ('0101000020E610000055B35EDE5B3D4BC0A55D08DD094C13C0', 1, 'Ponto A'); | |
INSERT INTO "public"."teste" ("geom" , "id", "nome") VALUES ('0101000020E6100000C0815FAB35FE4BC0EF4C638C750032C0', 2, 'Ponto B'); | |
INSERT INTO "public"."teste" ("geom" , "id", "nome") VALUES ('0101000020E6100000DC0F25C3E0CB43C08C485C7141C722C0', 3, 'Ponto C'); |
This file contains 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
INSERT INTO "public"."residencias" ("geom" , "id", "cd_mun", "sigla_uf", "mun_dist", "nm_resid", "univer", "turma", "territ", "pop", "objeto", "coord", "periodo") VALUES ('0101000020E6100000902D18AE1F6841C0FBFECF895EB21CC0', 1, '2507507', 'PB', 'João Pessoa', 'Especialização em Assistência Técnica na área de Arquitetura, Urbanismo e Engenharia ', 'Departamento de Arquitetura e Urbanismo (UFPB)', '2ª', 'Comunidade do Aratu em Mangabeira', 'Aproximadamente 3800 famílias', 'Elaboração do Plano de Ação Periferia Viva', 'Amélia Panet e Daniel Andrade', 'Março/2024 e Setembro/2025'); | |
INSERT INTO "public"."residencias" ("geom" , "id", "cd_mun", "sigla_uf", "mun_dist", "nm_resid", "univer", "turma", "territ", "pop", "objeto", "coord", "periodo") VALUES ('0101000020E61000008D1B5D68C39442C06D7B151BFE9425C0', 2, '2803609', 'SE', 'Laranjeiras', 'Residência Multiprofissional em Assistência Técnica para Habitação e Direito à Cidade (HabCidade)', 'Faculdade de Arquitetura - Universidade Federal de Sergipe (UFS)', '1ª - |
This file contains 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; | |
DROP TABLE IF EXISTS "public"."exemplo" CASCADE; | |
BEGIN; | |
CREATE TABLE "public"."exemplo" ( "ogc_fid" SERIAL, CONSTRAINT "exemplo_pk" PRIMARY KEY ("ogc_fid") ); | |
SELECT AddGeometryColumn('public','exemplo','wkb_geometry',4326,'POINT',2); | |
CREATE INDEX "exemplo_wkb_geometry_geom_idx" ON "public"."exemplo" USING GIST ("wkb_geometry"); | |
ALTER TABLE "public"."exemplo" ADD COLUMN "id" NUMERIC(10,0); | |
ALTER TABLE "public"."exemplo" ADD COLUMN "nome" VARCHAR(255); | |
INSERT INTO "public"."exemplo" ("wkb_geometry" , "id", "nome") VALUES ('0101000020E6100000712DE8D472274BC008E7441A777220C0', 1, 'Ponto A'); | |
INSERT INTO "public"."exemplo" ("wkb_geometry" , "id", "nome") VALUES ('0101000020E61000006ECECB8D1A7F42C091064D9C99E520C0', 2, 'Ponto B'); |
This file contains 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
-- | |
-- PostgreSQL database dump | |
-- | |
-- Dumped from database version 13.13 | |
-- Dumped by pg_dump version 13.13 | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET idle_in_transaction_session_timeout = 0; |
This file contains 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 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 CLIENT_ENCODING TO UTF8; | |
SET STANDARD_CONFORMING_STRINGS TO ON; | |
BEGIN; | |
INSERT INTO "info_doacao_rgs" ("id","organizaca","pix","local","endereco","latitude","longitude","telefone","link_doaca","layer","path",geom) VALUES ('1','Aeroclube de Novo Hamburgo','FALSO','VERDADEIRO','Rua Ana Terra,10,Canudos,Novo Hamburgo,Rio Grande do Sul,Brasil','-29.698300700000001','-51.083739100000003','(51) - 3595-3814',NULL,'local','/Users/marcellodebarrosfilho/Desktop/SHP/Doacao_no_local.shp','0101000020E6100000C0F27BF6B78A49C01F46ADD5C3B23DC0'); | |
INSERT INTO "info_doacao_rgs" ("id","organizaca","pix","local","endereco","latitude","longitude","telefone","link_doaca","layer","path",geom) VALUES ('2','Aeroclube de Porto Alegre','FALSO','VERDADEIRO','Avenida Juca Batista,8101,Belém novo,Porto Alegre,Rio Grande do Sul,Brasil','-30.185840200000001','-51.174930099999997','(51) - 3245-6060 / (51) 98413-0026',NULL,'local','/Users/marcellodebarrosfilho/Desktop/SHP/Doacao_no_local.shp','0101000020E6100000024B091C649649C038482D39932F3 |
This file contains 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
INSERT INTO public.caravanas (id, geom, data, estado, caravana, municipio, territorio, ano, tema) VALUES (17, '0101000020E6100000848FD2B6ABF445C02A464C3F97CF33C0', '15/04/2023', 'BH', 'BELO HORIZONTE', 'Belo Horizonte', 'Complexo Izidora', 2023, 'Caravana Periferia Viva'); | |
INSERT INTO public.caravanas (id, geom, data, estado, caravana, municipio, territorio, ano, tema) VALUES (18, '0101000020E61000001278712C39F445C0232AF97DA4ED33C0', '15/04/2023', 'BH', 'BELO HORIZONTE', 'Belo Horizonte', 'Kilombo Manzo', 2023, 'Caravana Periferia Viva'); | |
INSERT INTO public.caravanas (id, geom, data, estado, caravana, municipio, territorio, ano, tema) VALUES (19, '0101000020E6100000725BC75D29F247C0DB1C42F053982FC0', '27/04/2023', 'DF', 'BRASÍLIA', 'BRASÍLIA', NULL, 2023, 'Caravana Periferia Viva'); | |
INSERT INTO public.caravanas (id, geom, data, estado, caravana, municipio, territorio, ano, tema) VALUES (20, '0101000020E610000068F228F0A9A248C07024D060536F39C0', '30/09/2023', 'PR', 'CURITIBA', 'Curitiba', 'Núcleo Periférico', 20 |
This file contains 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 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
delete from iniciativa where origem = 'redus'; |
This file contains 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
INSERT INTO public.iniciativa (id, nome_acao, nome_comunidade, localidade, organizacao, categoria, uf, municipio_cadastro, origem, premiado, ano, geom, municipio_bbox_id, organizacao_slug, id_resposta) VALUES (2600, 'Portal Favelas ', 'Rio de Janeiro ', 'Maré, 21042, Rio de Janeiro, Rio de Janeiro, Brasil', 'Portal Favelas ', 'Acesso à Justiça e Combate às Desigualdades', 'RJ', 'Rio de Janeiro', 'redus', false, NULL, '0101000020E61000003B014D840D9F45C024B9FC87F4DB36C0', 2417, 'portal-favelas', '7dfc0656-843b-4c6a-8085-c9bf67d81855'); | |
INSERT INTO public.iniciativa (id, nome_acao, nome_comunidade, localidade, organizacao, categoria, uf, municipio_cadastro, origem, premiado, ano, geom, municipio_bbox_id, organizacao_slug, id_resposta) VALUES (2646, 'Projeto social filhos da inclusão ', 'Ilha de Santa Terezinha ', 'Rua Mário Albuquerque Cavalcanti, Santo Amaro, Recife - Pernambuco, 50110, Brasil', 'Filhos da inclusão ', 'Saúde Integral e Dignidade Humana', 'PE', 'Recife', 'redus', false, NULL, '0101000020E6100000 |
NewerOlder