{"id":21343581,"url":"https://github.com/xavier-maruff/wgeo","last_synced_at":"2025-03-16T03:13:57.684Z","repository":{"id":169902803,"uuid":"423787822","full_name":"Xavier-Maruff/wgeo","owner":"Xavier-Maruff","description":"A C/C++ Wi-Fi-based geolocation library","archived":false,"fork":false,"pushed_at":"2022-03-11T06:33:13.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T15:47:54.887Z","etag":null,"topics":["geolocation","library","wireless-access-point"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xavier-Maruff.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-02T09:52:16.000Z","updated_at":"2024-10-29T11:57:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"0641d9aa-93fb-43c8-89d9-410b9843724b","html_url":"https://github.com/Xavier-Maruff/wgeo","commit_stats":null,"previous_names":["xavier-maruff/wgeo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xavier-Maruff%2Fwgeo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xavier-Maruff%2Fwgeo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xavier-Maruff%2Fwgeo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xavier-Maruff%2Fwgeo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xavier-Maruff","download_url":"https://codeload.github.com/Xavier-Maruff/wgeo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818199,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation","library","wireless-access-point"],"created_at":"2024-11-22T01:13:53.500Z","updated_at":"2025-03-16T03:13:57.680Z","avatar_url":"https://github.com/Xavier-Maruff.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wgeo\nWgeo, or \"wi-fi geolocator\", is a cross-platform C/C++ library for wifi-based device geolocation, utilising public wireless access point location databases.\n\n## compatibility\n| OS | Compatible |\n| --- | --- |\n| Windows 10 | ✅ |\n| Windows 7 | ✅ |\n| Linux* | ✅ |\n| macOS | Soon |\n\n\u003csub\u003e\\* - The linux implementation requires root permissions in order to perform a WAP scan.\u003c/sub\u003e\n## usage\nWgeo exposes a simple C API which abstracts the actual geolocation process. The API consists of two functions:\n```c\n//sets the wgeo api host, route, and key\n//successful if return value == WGEO_SUCCESS\nint wgeo_set_api_req(char* host, char* route, char* api_key);\n\n//scans WAPs, queries API, writes resultant latitude and longitude (+ result accuracy) to the supplied pointers\n//successful if return value == WGEO_SUCCESS\nint wgeo_get_location(double* lat, double* lon, double* accuracy);\n```\nIf you would like to use wgeo as a shared library, ensure that you define the `__WGEO_SHARED__` macro before including the header file (check the `examples` folder).\n\n## building\nThe wgeo repo provides bash and batch build scripts, which require CMake to be installed.\n\nUsage:\n```bash \n# linux\n./tools/build.sh (one of 'Debug', 'Release', or nothing)\n```\n```batch\n@REM windows\ntools\\build (one of 'Debug', 'Release', or nothing)\n```\n\n## installing\nAfter compiling wgeo, copy the `include/wgeo` directory to somewhere your compiler can find it, and the contents of the `lib` directory to somewhere your linker can find them.\nLinux example:\n```bash\nsudo cp -r include/wgeo /usr/include\nsudo cp lib/* /usr/lib\n```\n### platform-independent external dependencies:\n* Boost\n* OpenSSL\n\n### linux additional dependencies:\n* libiw-dev\n* libiw30\n\n## testing\nWgeo utilises GTest for testing, and can be run using the bash or batch `test` scripts, which rely on `ctest`.\nTo set up your environment, create the file `tools/env.txt` and write your Google geolocation API key to it.\n\nTo run the tests:\n```bash\n# linux\nsudo ./tools/test.sh\n```\n```batch\n@REM windows\ntools\\test\n```\n\n## full usage example\nMore examples can be found in the `examples` directory.\n```c\n#include \u003cwgeo/wgeo.h\u003e\n#include \u003cstdio.h\u003e\n\n#define API_HOST \"https://www.googleapis.com\"\n#define API_ROUTE \"/geolocation/v1/geolocate?key=%s\"\n#define MY_API_KEY \"some_garbled_characters\"\n\n\nint main(int argc, char** argv){\n    double lat = 0, lon = 0, accuracy = 0;\n    int wgeo_status = 0;\n\n    wgeo_status = wgeo_set_api_req(API_HOST,  API_ROUTE,  MY_API_KEY);\n    if(wgeo_status != WGEO_SUCCESS) {\n        perror(\"error: could not set up API request\\n\");\n        return -1;\n    }\n\n    wgeo_status = wgeo_get_location(\u0026lat, \u0026lon, \u0026accuracy);\n    if(wgeo_status != WGEO_SUCCESS){\n        perror(\"error: could not get location\\n\");\n        return -1;\n    }\n\n    printf(\"latitude, longitude: (%f, %f)\\n\", lat, lon);\n    printf(\"accuracy: %f\\n\", accuracy);\n    return 0;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavier-maruff%2Fwgeo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxavier-maruff%2Fwgeo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxavier-maruff%2Fwgeo/lists"}