compress_latlon {healthyAddress} | R Documentation |
Compress latitude and longitude to a 32-bit integer
Description
Although lat and lon are represented by doubles, this is usually slightly wasteful. This function allows you to represent coordinates as single integer, vastly reducing memory footprint.
Usage
compress_latlon(lat, lon, nThread = getOption("healthyAddress.nThread", 1L))
decompress_latlon(x, nThread = getOption("healthyAddress.nThread", 1L))
compress_latlon_general(
lat,
lon,
nThread = getOption("healthyAddress.nThread", 1L)
)
decompress_latlon_general(x, nThread = getOption("healthyAddress.nThread", 1L))
Arguments
lat , lon |
Coordinates to compress. |
nThread |
Number of threads to use. |
x |
An integer vector formed by one of the compression functions. |
Value
The _general
version of the compression/decompression use the observed
range of the latitude and longitude to form a 2^16
grid, while the
bare versions use the known limits of Australian address coordinates
(including the overseas territories). Since, in the latter, the grid
will be much less fine, you should expect greater loss of information,
possibly exceeding 100 metres.
compress_latlon
An integer vector.
decompress_latlon
The original
lat,lon
, with some information losscompress_latlon_general
An integer vector, with attributes
minmaxLat
andminmaxLon
.decompress_latlon_general
The original
lat,lon
, with some information loss.