Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

earthutils

Summary

This NPM package contains utilities for mapping based applications.

Install

$ npm install earthutils

API

Direction Abbreviations

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

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

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"
}
*/

About

📦 NPM Package - Utilities for mapping-based applications

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages