Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| # 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): | |
| ''' |
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/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.
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
| 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 |
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
| 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 |
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 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 |
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
| ogr2ogr -f "ESRI Shapefile" output.shp input.shp -lco ENCODING=UTF-8 -s_srs EPSG:$INSRID -t_srs EPSG:$OUTSRID |