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