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
| -- public.st_safe_intersection() | |
| CREATE OR REPLACE FUNCTION ST_Safe_Intersection(geom_a geometry, geom_b geometry) | |
| RETURNS geometry | |
| LANGUAGE plpgsql | |
| IMMUTABLE STRICT | |
| AS $function$ | |
| BEGIN | |
| RETURN ST_Intersection(geom_a, geom_b); | |
| EXCEPTION |
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
| """ | |
| This script should be run from the Python consol inside QGIS. | |
| It adds online sources to the QGIS Browser. | |
| Each source should contain a list with the folowing items (string type): | |
| [sourcetype, title, authconfig, password, referer, url, username, zmax, zmin] | |
| You can add or remove sources from the sources section of the code. | |
| Script by Klas Karlsson |
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
| #--------------------------------------------------------------------------------------------- | |
| # VAZIOS DO CADASTRO AMBIENTAL RURAL | |
| # | |
| # Autores: Felipe Cerignoni e Vinicius Guidotti | |
| # Ultima atualização: 07/2022 | |
| #--------------------------------------------------------------------------------------------- | |
| # IMPORTING MODULES | |
| import arcpy | |
| from arcpy import env |
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
| gdal_rasterize -a rast -a_nodata NoData -l 1_pa_br_hidro_urbano_ibge -ts 155239 158459 -te -74.8973961 -34.79175510 -33.0613262 7.9120915 -ot UInt16 -co "TILED=YES" -co "BLOCKXSIZE=256" -co "BLOCKYSIZE=256" -co "COMPRESS=LZW" 1_pa_br_hidro_urbano_ibge.shp 1_pa_br_hidro_urbano_ibge.tif | |
| gdal_rasterize -a rast -a_nodata NoData -l 2_pa_br_territorio_indigena_funai_h_2022 -ts 155239 158459 -te -74.8973961 -34.79175510 -33.0613262 7.9120915 -ot UInt16 -co "TILED=YES" -co "BLOCKXSIZE=256" -co "BLOCKYSIZE=256" -co "COMPRESS=LZW" 2_pa_br_territorio_indigena_funai_h_2022.shp 2_pa_br_territorio_indigena_funai_h_2022.tif | |
| gdal_rasterize -a rast -a_nodata NoData -l 3_pa_br_territorio_indigena_funai_nh_2022 -ts 155239 158459 -te -74.8973961 -34.79175510 -33.0613262 7.9120915 -ot UInt16 -co "TILED=YES" -co "BLOCKXSIZE=256" -co "BLOCKYSIZE=256" -co "COMPRESS=LZW" 3_pa_br_territorio_indigena_funai_nh_2022.shp 3_pa_br_territorio_indigena_funai_nh_2022.tif | |
| gdal_rasterize -a rast -a_nodata NoData -l 4_pa_br_ucs_pi_mma_2020 -ts 15 |
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
| INSERT INTO spatial_ref_sys (srid,auth_name,auth_srid,srtext,proj4text) VALUES | |
| (97823,'sr-org',7823,'PROJCS["Conica_Equivalente_de_Albers_Brasil",GEOGCS["GCS_SIRGAS2000",DATUM["D_SIRGAS2000",SPHEROID["Geodetic_Reference_System_of_1980",6378137,298.2572221009113]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Albers"],PARAMETER["standard_parallel_1",-2],PARAMETER["standard_parallel_2",-22],PARAMETER["latitude_of_origin",-12],PARAMETER["central_meridian",-54],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]','+proj=aea +lat_1=-2 +lat_2=-22 +lat_0=-12 +lon_0=-54 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs'); | |
| --DROP MATERIALIZED VIEW limites.pa_br_limite_line; | |
| CREATE MATERIALIZED VIEW limites.pa_br_limite_line AS ( | |
| WITH dump AS ( | |
| SELECT (st_dump(geom)).geom FROM limites.pa_br_limite | |
| ) | |
| SELECT row_number() OVER () as id, st_exteriorring(geom) as geom FROM dump | |
| ); |
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
| -- Functions to help to process Atlas Layers | |
| ------------------------------------------------------------------------------- | |
| -- ST_Safe_Intersection | |
| ----------------------------------------------------------- | |
| -- Felipe Cerignoni ([email protected]) | |
| -- 2020 | |
| ----------------------------------------------------------- | |
| CREATE OR REPLACE FUNCTION ST_Safe_Intersection(geom_a geometry, geom_b geometry) |
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
| --===================================================================================== | |
| -- CLEANING THE CAR | |
| --===================================================================================== | |
| -- Author: Felipe Cerignoni | |
| -- Institution: Imaflora | |
| -- Last update: 10/05/2021 | |
| --===================================================================================== | |
| --------------------------------------------------------------------------------------- | |
| -- MATERIALIZED VIEW TO IDENTIFY ALL OVERLAPS------------------------------------------ | |
| CREATE MATERIALIZED VIEW car.pa_br_20210412_areaimovel_ovlps |
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 React from 'react'; | |
| // constraints_sample = { | |
| // enableHighAccuracy: true, | |
| // timeout: 5000, | |
| // maximumAge: 0, | |
| // }; | |
| export function useGeoLocation(constraints) { | |
| const [location, setLocation] = React.useState(null); |
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
| """ | |
| Download WFS | |
| Download Shapefile DETER | |
| Copyright 2020 TerraBrasilis | |
| Usage: | |
| download-deter-data.py | |
| Options: |