Documentation
¶
Index ¶
- func Cast[M ~map[K]V, K comparable, V any](input M) map[K]any
- func Inverse[K, V comparable](input map[K]V) map[V]K
- func Keys[M ~map[K]V, K comparable, V any](input M) []K
- func MergeJSON(x1, x2 []byte, orderBy func(output map[string]any) any) ([]byte, error)
- func PrettyPrintJSON(content []byte, name string) []byte
- func ReadFile(filePath string) string
- func SurfaceArea(bbox *geom.Bounds) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cast ¶
func Cast[M ~map[K]V, K comparable, V any](input M) map[K]any
Cast turns a map[K]V to a map[K]any, so values will downcast to 'any' type.
func Inverse ¶
func Inverse[K, V comparable](input map[K]V) map[V]K
Inverse switches the values to keys and the keys to values.
func Keys ¶
func Keys[M ~map[K]V, K comparable, V any](input M) []K
Keys returns the keys of the map m. The keys will be an indeterminate order.
func MergeJSON ¶
MergeJSON merges the two JSON byte slices. It returns an error if x1 or x2 cannot be JSON-unmarshalled, or the merged JSON is invalid.
Optionally, an orderBy function can be provided to alter the key order in the resulting JSON
func PrettyPrintJSON ¶
func SurfaceArea ¶ added in v0.1.22
func SurfaceArea(bbox *geom.Bounds) float64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.