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
#!/bin/sh | |
# Author: Marcello Benigno, May/2013; copyright: GPL >= 2 | |
# Purpose: Create a reclass slope map | |
# Usage: ./declividade.sh | |
#----------------------------------------------------------- | |
#verifica se o GRASS está em execução: | |
if [ -z "$GISBASE" ] ; then | |
echo "ERRO: O GRASS não está em execução!" | |
exit 1 | |
fi |
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
#!/bin/sh | |
for f in *.tif | |
do | |
echo "Processando $f ..." | |
gdalwarp -s_srs EPSG:32722 -t_srs EPSG:4326 $f geo/WGS84-$f |
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
MAP | |
NAME "WMS-Mapserver" | |
STATUS ON | |
SIZE 800 600 | |
UNITS dd | |
EXTENT -38.864434 -8.478194 -34.694095 -5.851767 | |
PROJECTION | |
"init=epsg:3857" | |
END |
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
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Exemplo Leaflet - WMS Mapserver</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" /> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script> | |
<script type="text/javascript" src="js/Google.js"></script> | |
<!--[if lte IE 8]> |
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
SELECT bairro, | |
sum(CASE WHEN sexo ='MASCULINO' THEN 1 ELSE 0 END) AS total_homens, | |
sum(CASE WHEN sexo ='FEMININO' THEN 1 ELSE 0 END) AS total_mulheres | |
FROM acidentes | |
GROUP BY bairro | |
ORDER BY total_homens DESC, total_mulheres DESC; |
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
# definição do driver sqlite para armazenamento das tabelas (importante!!!) | |
db.connect driver=sqlite database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db' | |
# verificando a conexão | |
db.connect -p | |
# criação da camada contendo os polígonos de thiessen | |
v.voronoi input=rainfall_gauges output=thiessen | |
# clip da camada thiessen com os limites da bacia hidrográfica | |
v.overlay ainput=thiessen binput=basin output=clip_thiessen operator=and | |
# criação do campo area_km2 | |
v.db.addcol map=clip_thiessen columns='area_km2 double precision' |
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
/***************************************************************************** | |
* Copyright (c) 2003-2009 Armin Burger | |
* | |
* p.mapper is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. See the COPYING file. | |
* | |
* p.mapper is distributed in the hope that it will be useful, |
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
SELECT a.gid, ST_Closestpoint(ST_Collect(b.geom), a.geom) AS geom | |
FROM section_points a, streams b | |
GROUP BY a.gid, a.geom; |
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
--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'; |
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
-- 1. Quais são os municípios vizinhos de Camapuã? Utilize a função ST_Touches() | |
SELECT a.gid, a.nome, a.geom | |
FROM municipios a, municipios b | |
WHERE ST_Touches(a.geom, b.geom) | |
AND b.nome = 'Camapuã'; | |
-- 2. Quais são os municípios cortados pela rodovia 'MS-351'? Utilize a função ST_Intersects() | |
SELECT DISTINCT m.gid, m.nome, m.geom | |
FROM municipios m, rodovias r | |
WHERE ST_Intersects(r.geom, a.geom) |