Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rrainn/earthutils
https://github.com/rrainn/earthutils
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rrainn/earthutils
- Owner: rrainn
- License: unlicense
- Created: 2021-07-04T00:49:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-25T20:23:12.000Z (over 3 years ago)
- Last Synced: 2024-12-09T16:55:56.681Z (30 days ago)
- Language: TypeScript
- Size: 871 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# earthutils
## Summary
This NPM package contains utilities for mapping based applications.
## Install
```
$ npm install earthutils
```## API
### Direction Abbreviations
```js
const earthutils = require("earthutils");console.log(earthutils.DirectionAbbreviations.DirectionAbbreviations);
/*
{
"N": "North",
"E": "East",
"S": "South",
"W": "West"
}
*/console.log(earthutils.DirectionAbbreviations.DirectionAbbreviationsInverse);
/*
{
"North": "N",
"East": "E",
"South": "S",
"West": "W"
}
*/
```### Street Standardize
```js
const earthutils = require("earthutils");console.log(earthutils.StreetStandardize("S Headquarters Plaza")); // South Headquarters Plaza
console.log(earthutils.StreetStandardize("S HEADQUARTERS PLAZA")); // South Headquarters Plaza
console.log(earthutils.StreetStandardize("Headquarters Plaza")); // Headquarters Plaza
console.log(earthutils.StreetStandardize("Headquarters AVE")); // Headquarters Avenue
```### Address Parser
```js
const earthutils = require("earthutils");console.log(earthutils.AddressParser("123 Headquarters Plaza"));
/*
{
"addr:housenumber": "123",
"addr:street": "Headquarters Plaza"
}
*/console.log(earthutils.AddressParser("123 Headquarters Plaza Ste 12"));
/*
{
"addr:housenumber": "123",
"addr:street": "Headquarters Plaza",
"addr:unit": "12",
"addr:unitname": "Suite"
}
*/console.log(earthutils.AddressParser("123 S Headquarters Plaza", {"standardizeStreet": true})); // `standardizeStreet` will run `addr:street` through the Street Standardize function automatically
/*
{
"addr:housenumber": "123",
"addr:street": "South Headquarters Plaza"
}
*/
```