library(here)
here()
library(readxl)
#setwd("~/Masterarbeit/Statistik")
library(tidyverse); theme_set(theme_bw())
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 arcpy | |
| def ZoomToTargetBKMK(BookmarkNr): | |
| aprx = arcpy.mp.ArcGISProject(r"CURRENT") | |
| MapView = aprx.activeView | |
| Map = MapView.map | |
| TargetBkmk = Map.listBookmarks()[BookmarkNr] | |
| print("Target bookmark: {}".format(TargetBkmk.name)) | |
| MapView.zoomToBookmark(TargetBkmk) |
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
| .libPaths | |
| packages <- c("tidyverse", | |
| "sf", | |
| ) | |
| package.check <- lapply( | |
| packages, | |
| FUN = function(x) { |
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 arcpy | |
| aprx = arcpy.mp.ArcGISProject("Current") | |
| m = aprx.listMaps("Map")[0] | |
| layers = m.listLayers() | |
| for layer in layers: | |
| layer.visible = False |
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
| # Rayshader basic workflow | |
| # By Tobias Stalder | |
| # October 2022 | |
| # Creative Commons licence (Free to use - Reference Author in Code by Publication) | |
| # libraries --------------------------------------------------------------- | |
| memory.limit(size=4000000000) #set memory limit |
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 geopandas as gpd | |
| import pandas as pd | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| #set pandas options so that all column names are diplayed when printes | |
| pd.set_option('display.max_columns', None) | |
| pd.set_option('display.max_rows', None) | |
| ######load gdb with arcpy and convert to pd dataframe######### |
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
| # work with arcpy in Rmarkdown or Rscript using reticulate | |
| #set up python version in R | |
| ```{r} | |
| library(reticulate) | |
| use_python("C:/Python27/ArcGIS10.7/python.exe", required = TRUE) | |
| ``` | |
| #check Sysinfo | |
| ```{python engine.path="C:/Python27/ArcGIS10.7/python.exe"} |
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
| #a snippet for quick plots of LIDAR data in ggplot2 | |
| #Tobias Stalder | |
| #June 2021 | |
| #load libraries | |
| library(tidyverse) | |
| library(rlas) | |
| library(gg3D) | |
| #load data |
#By Tobias Stalder #August 2020
library(scales)
eco_river_pal <- c("#d0ece7", "#a9dfbf", "#73c6b6", "#27ae60", "#117a65",