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

cellsAffectedLine

find which cells of data area affected by points

checkOverlap

Check if two rasters overlap

checkParticlesInRelease

remove particles laying outside the polygon

checkProfile

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

computeAlongLineDistance

compute distance along a dict of coordinates or a shapely lineString incrementally

computeLengthOfLine2D

compute distance along a line in 2D

computeS

compute s coordinate given a path (x, y)

findAngleProfile

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

findClosestPoint

find the closest point of pointDict along line defined by xcoor and ycoor - only xy plane!

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.

getCellsAlongLine

Find all raster cells crossed by the line line has to be entierly contained on the raster extend.

getNeighborCells

Find the neighbour cells to a given cell

getNormalArray

Interpolate vector field from grid to unstructured points

getNormalMesh

Compute normal to surface at grid points

isCounterClockWise

Determines if a polygon path is mostly clockwise or counter clockwise

makeCoordGridFromHeader

Get x and y (2D) grid description vectors for a mesh with a given number of rows and columns, lower left center and cellSize.

makeCoordinateGrid

Create grid

path2domain

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

pointInPolygon

find particles within a polygon

polygon2Raster

convert line to raster

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

prepareArea

convert shape file polygon to raster

prepareLine

Resample and project line on dem 1- Resample the avapath line with an interval of approximately distance in meters between points (projected distance on the horizontal plane).

prepareLineStrict

Resample and project line on dem, with strict settings, i.e. to follow the line as close as possible.

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)

remeshData

compute raster data on a new mesh with cellSize using the specified remeshOption.

remeshRaster

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

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

rotateRaster

rotate clockwise a raster arround (0, 0) with theta angle

searchRemeshedRaster

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

snapPtsToLine

snap points to line in dataframe only considering x, y plane!