group
group__libshare__sysgeo
Perform geodetic calculations involving location metrics.

Geodetic Calculations

typedef
typedef struct shgeo_t shgeo_t
typedef
typedef struct shloc_t shloc_t
function
void shgeo_set
(shgeo_t *geo, shnum_t lat, shnum_t lon, int alt)
Establish a geodetic location based off a latitude, longitude, and optional altitude.
function
void shgeo_loc
(shgeo_t *geo, shnum_t *lat_p, shnum_t *lon_p, int *alt_p)
Obtain the latitude, longitude, and altitude for a geodetic location.
function
time_t shgeo_lifespan
(shgeo_t *geo)
The duration since the geodetic location was established in seconds.
function
shkey_t* shgeo_tag
(shgeo_t *geo, int prec)
A 'key tag' representing the geodetic location in reference to a particular precision.
function
int shgeo_cmp
(shgeo_t *geo, shgeo_t *cmp_geo, int prec)
Compare two geodetic locations for overlap based on precision specified.
function
int shgeo_cmpf
(shgeo_t *geo, double lat, double lon)
function
double shgeo_radius
(shgeo_t *f_geo, shgeo_t *t_geo)
The combined latitude and longitude distances between two geodetic locations.
function
void shgeo_dim
(shgeo_t *geo, int prec)
Reduce the precision of a geodetic location.
function
void shgeo_local
(shgeo_t *geo, int prec)
Obtain the device's current location.
function
void shgeo_local_set
(shgeo_t *geo)
Manually set the device's current location.
function
int shgeodb_scan
(shnum_t lat, shnum_t lon, shnum_t radius, shgeo_t *geo)
Search an area for a known geodetic location.
function
int shgeodb_place
(const char *name, shgeo_t *geo)
Search for a known geoetic location based on a location name.
function
int shgeodb_host
(const char *name, shgeo_t *geo)
Search for a known geodetic location given an IP or Host network address.
function
int shgeodb_loc
(shgeo_t *geo, shloc_t *loc)
Search for a known geodetic location given an IP or Host network address.
function
int shgeodb_loc_set
(shgeo_t *geo, shloc_t *loc)
Set custom location information for a particular geodetic location.
function
int shgeodb_loc_unset
(shgeo_t *geo)
function
const char* shgeo_place_desc
(char *code)
A formal description of a particular place code.
function
int shgeo_place_prec
(char *code)
The geometric precision for a particular place type.
function
const char** shgeo_place_codes
(void)
An array of codes signifying difference types of places.
function
int shgeodb_rowid
(shdb_t *db, const char *table, shgeo_t *geo, shdb_idx_t *rowid_p)
Obtain a rowid for a particular geodetic location in a given database.
function
int shgeodb_name
(shdb_t *db, char *table, const char *name, shgeo_t *geo)
Obtain a geodetic location from a location name in a given database.
define
SHGEO_PREC_REGION
0
Location precision of a 'regional area'.
Roughly 3000 square miles.
define
SHGEO_PREC_ZONE
1
Location precision of a 'zone'.
Roughly 30 square miles.
define
SHGEO_PREC_DISTRICT
2
Location precision of a 'district of land'.
Roughly 0.3 square miles.
define
SHGEO_PREC_SITE
3
Location precision of a 'land site'.
Roughly 85,000 square feet.
define
SHGEO_PREC_SECTION
4
Location precision of a 'section of area'.
Roughly 800 square feet.
define
SHGEO_PREC_SPOT
5
Location precision of a 'spot of land'.
Roughly 8 square feet.
define
SHGEO_PREC_POINT
6
Location precision of a single point.
Roughly 10 square inches.
define
SHGEO_MAX_PRECISION
6
The number of precision specifications available.
define
SHGEO_SYSTEM_DATABASE_NAME
"geo"
The system-level geodetic database.
define
SHGEO_USER_DATABASE_NAME
"geo.usr"
The user-level geodetic database.
define
SHGEO_ZIPCODE
"sys_zipcode_NA"
A database table containing common north-america zipcodes.
define
SHGEO_COMMON
"sys_common_NA"
A database table containing common north-america places.
define
SHGEO_NETWORK
"sys_network_NA"
A database table containing common north-america IP address locations.
define
SHGEO_CITY
"sys_city_NA"
A database table containing common north-america city names.