Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yagiziskirik/this4words
Encodes and decodes geolocation data to four words with 1.11 meters of accuracy.
https://github.com/yagiziskirik/this4words
api geolocation nodejs python this4words what3words
Last synced: 7 days ago
JSON representation
Encodes and decodes geolocation data to four words with 1.11 meters of accuracy.
- Host: GitHub
- URL: https://github.com/yagiziskirik/this4words
- Owner: yagiziskirik
- License: mit
- Created: 2022-12-09T18:39:42.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T23:27:20.000Z (about 2 years ago)
- Last Synced: 2024-12-20T02:27:19.647Z (15 days ago)
- Topics: api, geolocation, nodejs, python, this4words, what3words
- Language: JavaScript
- Homepage:
- Size: 98.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# This4Words
![Version 0.1.0a](https://img.shields.io/badge/version-0.1.0a-blue) ![License](https://img.shields.io/badge/Licence-MIT-green) ![Maintenance](https://img.shields.io/maintenance/yes/2023)This4Words is the What3Words replication project which accurately pinpoints a location with precision up to 1 meters and 11 centimetres. What4Words gives results like `this.program.is.awesome` when inputted with geolocations. Currently, there are NodeJS and Python versions of the project are available, and all versions are capable of working offline.
## Setup
Setup of this project is pretty straight-forward since there are no dependencies.### NodeJS
`cd` into the project directory and run `npm i` command.### Python
There are no requirements.## Usage
Using the program is very straight-forward.### NodeJS
```
cd nodejs
npm run dev
```Runs the web server. After that, post request with appropriate bodies will give you the correct results.
#### Getting Words from the Coordinates
POST request to the `http://localhost/encrypt` address with the body of `{xCoord: YOUR_X_COORDINATE, yCoord: YOUR_Y_COORDINATE}` will give you the appropriate word group.#### Getting Coordinates from the Words
POST request to the `http://localhost/decrypt` address with the body of `{str: YOUR_WORD_GROUP}` will give you the appropriate coordinates.### Python
```
cd python
```And from there, import the library with the following script and use like this:
```py
from this4words import This4Words
t4w = This4Words()
t4w.encrypt(YOUR_X_COORDINATE, YOUR_Y_COORDINATE) # Gives you the appropriate word group
t4w.decrypt('YOUR_WORD_GROUP') # Gives you the appropriate coordinates
```