in3Utils.geoTrans

Opperations and transformations of rasters and lines

Functions

areaPoly

Gauss’s area formula to calculate polygon area

cartToSpherical

convert from cartesian to spherical coordinates

checkOverlap

Check if two rasters overlap

checkProfile

check that the avalanche profiles goes from top to bottom flip it if not and adjust the splitpoint in consequence

findAngleProfile

Find the beta point: first point under the beta value given in prepareAngleProfile.

findPointOnDEM

find point on dem given a direction and a z value to reach

findSplitPoint

Finds the closest point in Points to the AvaProfile and returns its projection on AvaProfile.

getMeshXY

Get x and y vectors for mesh with given number of rows and columns, lowerleftcenter and cellSize

isCounterClockWise

Determines if a polygon path is mostly clockwise or counter clockwise

path2domain

Creates a domain (irregular raster) along a path, given the path xyPath, a domain width and a raster cellsize

prepareAngleProfile

Prepare inputs for findAngleProfile function Read profile (s, z), compute the slope Angle look for points for which the slope is under the given Beta value and that are located downstream of the splitPoint

prepareLine

Resample and project line on dem 1- Resample the avapath line with a max intervall of distance=10m between points (projected distance on the horizontal plane).

projectOnGrid

Projects Z onto points (x,y) using a bilinear or nearest interpolation and returns the z coord

projectOnRaster

Projects Points on raster using a bilinear or nearest interpolation and returns the z coord (no for loop)

remeshDEM

change DEM cell size by reprojecting on a new grid - first check if remeshed DEM available

remeshData

compute raster data on a new mesh with cellSize using scipy RectBivariateSpline

resizeData

Reproject raster on a grid of shape rasterRef

rotate

rotate a vector provided as start and end point with theta angle rotation counter-clockwise

searchRemeshedDEM

search if remeshed DEM with correct name and cell size already available