infer_crs: Infer crs

View source: R/infer_crs.R

infer_crsR Documentation

Infer crs

Description

This function will project occurrences to a list of ~6600 crs, find nearest 4 points, find the angle to the 4 points, then take reminder %%90, the smaller the better also find the distance to the 4 points, then all the distance is standardized to 0 mean and 1sd then do a histogram, and calculate the freq of each bin, pick the bin with highest freq ideally, the true crs will lead to the highest freq in that bin.

Usage

infer_crs(
  occ_path,
  truth_crs_num = NA,
  flag_saveTemp = TRUE,
  flag_newCal = TRUE,
  temp_path = "data/3_infer_grid_crs_temp/",
  cup_num = 2,
  flag_debug = -1
)

Arguments

occ_path

Character. A string, path of input occurrences, should have decimalLongitude & decimalLatitude.

truth_crs_num

Character. A string, epsg code of the true crs if known.

flag_saveTemp

Logical. If "True", save the middle output.

flag_newCal

Logical. If "True" do the distance calculation again.

temp_path

Character. Define a path to save.

cup_num

Numerical. To define the number of cores to use. Default is 2.

flag_debug

Numerical. Default -1.

Note

Using 15 cores, it took ~10-20 minutes to finish this workflow.

Author(s)

Xiao Feng


BiogeographyLab/gridder documentation built on April 21, 2024, 2:32 a.m.