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
# created by: Marcello Benigno | |
0 102 153 153 | |
1 236 241 230 | |
10 176 242 205 | |
50 180 246 179 | |
100 207 250 177 | |
150 242 252 179 | |
200 220 238 145 | |
250 147 208 93 | |
300 69 179 53 |
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
#!/bin/bash | |
# Author: Marcello Benigno, Mar/2014; copyright: GPL >= 2 | |
# Purpose: Create a beautiful SRTM Hillshade color Map | |
# Usage: ./mosaic.sh | |
## Required programs: | |
## imagemagick | |
## gdal >=1.7.0 | |
## my_classes.cpt - download at | |
## <https://gist.github.com/marcellobenigno/9289976> |
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
# Adicionar uma projeção a um shapefile: | |
ogr2ogr -a_srs "EPSG:4291" output.shp input.shp | |
# Converter projeções: | |
ogr2ogr -t_srs "EPSG:4326" -s_srs "EPSG:4291" output.shp input.shp | |
# Ver os metadados sobre projeção: | |
ogrinfo -so input.shp input |
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
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateobrasTable extends Migration { | |
/** | |
* Run the migrations. | |
* |
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
<?php | |
class Obra extends Eloquent { | |
protected $fillable = array('nome_obra', 'geom'); | |
public static $rules = array( | |
'nome_obra'=>'required|min:3', | |
/* OBS: os campos abaixo servem para validação da coluna geom | |
e não existem na tabela Obra */ |
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
<?php | |
class ObrasController extends BaseController { | |
public function getIndex() { | |
$obras = DB::table('obras') | |
->select(DB::raw('ST_X(geom) as lng, ST_Y(geom) AS lat, nome_obra')) | |
->get(); |
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
<?php | |
class Municipio extends Eloquent { | |
public static function checkCoords($x, $y) { | |
$query = Municipio::whereRaw( | |
"ST_Contains(geom, ST_GeomFromText('POINT($x $y)', 4326))" | |
)->first(); |
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
# 1) Criação de um camada de pontos, contendo os vértices do rio principal | |
v.to.points -i -v -t in=out_dem_filled_mainchannel out=mchannel_pts type=line dmax=1000 | |
# 2) Exportação dos vértices para um arquivo txt | |
v.out.ascii mchannel_pts > coords.txt | |
# 3) Remoção dos pipes ("|") e da coluna cat do arquivo txt | |
cat coords.txt | awk -F "|" '{print $1,''$2}' > xy.txt | |
# 4) Substituição dos espaços por vírgulas |
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
MAP | |
NAME 'ceara' | |
EXTENT 168894 9143291 801185 9695478 | |
SIZE 650 600 | |
UNITS meters | |
SHAPEPATH 'shp' | |
PROJECTION | |
'init=epsg:29185' | |
END |
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
LAYER | |
NAME 'municipios_selecao' | |
STATUS DEFAULT | |
TYPE POLYGON | |
DATA 'municipios.shp' | |
FILTER ([idmun]=%idmun%) | |
VALIDATION | |
'idmun' '^[0-9]{1,3}$' | |
END | |
CLASS |
OlderNewer