CREATE INDEX ON ctrm_cafirweb (incra);
--TRUNCATE tabela;
-- | |
-- 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; |
from collections import defaultdict | |
from osgeo import ogr | |
from shapely.geometry import MultiLineString | |
from shapely.wkt import loads | |
ogr.UseExceptions() | |
class Demanda: |
--1. Qual é o valor da área em km2 do município de Campo Grande? | |
SELECT ST_Area(Geography(geom))/1000000 AS area_km2 | |
FROM municipios | |
WHERE nome = 'Campo Grande'; | |
--2. Qual é a área total das terras indígenas da tribo Buriti? | |
SELECT SUM(ST_Area(Geography(geom)))/1000000 AS area_km2 | |
FROM terras_indigenas | |
WHERE tribo = 'Buriti'; |
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() |
sexo = input('Informe seu sexo (m/f): ') | |
altura = float(input('Informe sua altura em metros (ex.: 1.75): ')) | |
peso = float(input('Informe o seu peso (em kg): ')) | |
if sexo == 'm': | |
peso_ideal = round((72.7 * altura) - 58, 2) | |
else: | |
peso_ideal = round((62.1 * altura) - 44.7, 2) | |
if peso > peso_ideal: |
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 |
<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> |
# Shell script to create a complete Django project. | |
# This script require Python 3.x and pyenv | |
# Settings.py is config to Django 1.9.3 | |
# The project contains: | |
# Settings config | |
# Person model and form | |
# Person list and detail | |
# Person create, update and delete | |
# Admin config |
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.
municipio_
para municipio