Skip to content

Instantly share code, notes, and snippets.

View lhndsp's full-sized avatar
🌱

Lucas Porto lhndsp

🌱
View GitHub Profile
@lhndsp
lhndsp / open-buildings-download-region-polygons-or-points.ipynb
Created May 28, 2024 12:45
Open Buildings - download region polygons or points.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lhndsp
lhndsp / geopandas_convert_geometry_3D_2D.py
Last active November 7, 2023 21:15 — forked from rmania/geopandas_convert_geometry_3D_2D.py
flatten geometry series (3D to 2D) in geopandas dataframe
# Often when reading in a ShapeFile from Basemap, you'll get: "ValueError: readshapefile can only handle 2D shape types"
# A trick can be to convert your geometry in your GeoPandas Dataframe and restoring the new flattened 2D geometry
# series back into a shapefile and try again.
# edit from http://stackoverflow.com/questions/33417764/basemap-readshapefile-valueerror
from shapely.geometry import Polygon, MultiPolygon, shape, Point
import geopandas as gp
def convert_3D_2D(geometry):
'''
#!/bin/bash
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 6 in line 6.
divisao,descricao_divisao,grupo,descricao_grupo,classe,descricao_classe,subclasse,descricao_subclasse
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.11-3,Cultivo de cereais,0111-3/01,Cultivo de arroz
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.11-3,Cultivo de cereais,0111-3/02,Cultivo de milho
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.11-3,Cultivo de cereais,0111-3/03,Cultivo de trigo
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.11-3,Cultivo de cereais,0111-3/99,Cultivo de outros cereais não especificados anteriormente
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.12-1,Cultivo de algodão herbáceo e de outras fibras de lavoura temporária,0112-1/01,Cultivo de algodão herbáceo
01,"AGRICULTURA, PECUÁRIA E SERVIÇOS RELACIONADOS",01.1,Produção de lavouras temporárias,01.12-1,Cultivo
@lhndsp
lhndsp / requirements.txt
Created May 30, 2022 17:27
pacotes para o projetinho de entrada em quant
attrs==19.3.0
backcall==0.1.0
certifi==2020.4.5.1
chardet==3.0.4
cycler==0.10.0
decorator==4.4.2
idna==2.9
importlib-metadata==1.6.0
ipykernel==5.2.1
ipython==7.14.0
@lhndsp
lhndsp / list.md
Created September 27, 2021 22:34 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@lhndsp
lhndsp / wfs.xml
Last active September 27, 2021 22:36
wfs, wms e tiles do qgis
<!DOCTYPE connections>
<qgsWFSConnections version="1.0">
<wfs name="ANATEL" username="" password="" url="http://sistemas.anatel.gov.br/geoserver/ANATEL/ows?version=1.3.0" referer=""/>
<wfs name="BNDES" username="" password="" url="https://geoservicos.inde.gov.br/geoserver/BNDES/ows?version=1.3.0" referer=""/>
<wfs name="CPRM" username="" password="" url="https://geoservicos.cprm.gov.br/geoserver/geologia/ows/?version=1.3.0" referer=""/>
<wfs name="FUNAI" username="" password="" url="http://cmr.funai.gov.br/geoserver/ows?version=1.3.0" referer=""/>
<wfs name="Geosampa Camadas" username="" password="" url="http://wfs.geosampa.prefeitura.sp.gov.br/geoserver/geoportal/wfs" referer=""/>
<wfs name="IBAMA" username="" password="" url="http://siscom.ibama.gov.br/geoserver/ows?version=1.3.0" referer=""/>
<wfs name="IBGE" username="" password="" url="https://geoservicos.ibge.gov.br/geoserver/ows?version=1.3.0" referer=""/>
<wfs name="INPE" username="" password="" url="http://terrabrasili
@lhndsp
lhndsp / srid2srid.sh
Created August 6, 2020 01:12
convert srid
ogr2ogr -f "ESRI Shapefile" output.shp input.shp -lco ENCODING=UTF-8 -s_srs EPSG:$INSRID -t_srs EPSG:$OUTSRID