An existing table may have much of the data that is needed for a known location table. This function accepts an incoming table and searches for required columns:
latitude columns are required but all others
If any of these optional columns are found, they will be used and the often slow and sometimes slightly inaccurate steps to generate that information will be skipped for locations that have non-missing data. Any additional columns of information that are not part of the required core metadata will be retained.
This method skips the assignment of columns like
elevation and all
address related fields that require web service requests.
Compared to initializing a brand new table and populating it one record at a time, this is a much faster way of creating a known location table from a pre-existing table of metadata.
table_initializeExisting( locationTbl = NULL, stateDataset = "NaturalEarthAdm1", countryCodes = NULL, distanceThreshold = NULL, measure = c("geodesic", "haversine", "vincenty", "cheap"), verbose = TRUE )
Tibble of known locations. This input tibble need not be a standardized "known location" table with all required columns. Missing columns will be added.
Name of spatial dataset to use for determining state codes, Default: 'NaturalEarthAdm1'
Vector of country codes used to optimize spatial searching. (See ?MazamaSpatialUtils::getStateCode())
Distance in meters.
One of "haversine" "vincenty", "geodesic", or "cheap"
specifying desired method of geodesic distance calculation. See
Logical controlling the generation of progress messages.
Known location tibble with the specified metadata columns. Any
locations whose circles (as defined by
distanceThreshold) overlap will
generate warning messages.
It is incumbent upon the user to address overlapping locations by one of:
reduce the distanceThreshold until no overlaps occur
assign one of the overlapping locations to the other location
"cheap" may be used to speed things up depending on
the spatial scale being considered. Distances calculated with
measure = "cheap" will vary by a few meters compared with those
measure = "geodesic".
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.