gisUtils

package module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

README

GIS Utils

This package is a go package that is utilities that are used by wwum 2020 CLI for the GIS functions that might want to be used in other programs as well. We decided this could then be a standalone package so that it can be added to many others with ease.

Functions

There are several functions in this package that help with spatial operations

Haversin Distance

Haversin Distance Formula for great arc distance on a sphere with accuracy for small distances. The formula returns the meters between two points using decimal latitude and longitude

Inverse Distance Weighted

Produces the inverse distance weighted results of a slice passed to it and returns a normalized 4 digit percentage of those values.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(lat1, lon1, lat2, lon2 float64) float64

Distance function returns the distance (in meters) between two points of

a given longitude and latitude relatively accurately (using a spherical
approximation of the Earth) through the Haversin Distance Formula for
great arc distance on a sphere with accuracy for small distances

point coordinates are supplied in degrees and converted into rad. in the func

distance returned is METERS!!!!!! http://en.wikipedia.org/wiki/Haversine_formula

func InverseDW

func InverseDW(dist []float64) ([]float64, error)

InverseDW is a function that takes in a slice of values and returns the weighted

distribution of each value in a slice of the same length.
This is also protected with a division by zero or negative with and error return

This function uses the "Shepard's" method to determine the values and is a simple appoach. It uses the exponent value of p = 2 which is the defacto standard of this equation. Reference: https://en.wikipedia.org/wiki/Inverse_distance_weighting

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL