@fuzzysaj/location-to-usa-county
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

@fuzzysaj/location-to-usa-county

npm (scoped) Build Status dependencies Status code coverage

A program to convert latitude/longitude coordinates into USA counties. Data is stored locally based on publicly available boundary files from United States Census Bureau.

Install

$ npm install @fuzzysaj/location-to-usa-county

Usage

With JavaScript:

const getLocToCountyLookupService = require('@fuzzysaj/location-to-usa-county');

(async ()=> {
  const locToCounty = await getLocToCountyLookupService(); 
  const county = await locToCounty(33.5038, -112.0253); // latitude, longitude for Phoenix
  // -> { county_name: "Maricopa", county_fips: "04013" }
})();

With TypeScript:

import { getLocToCountyLookupService, County } from '@fuzzysaj/location-to-usa-county'

(async ()=> {
  const locToCounty = await getLocToCountyLookupService();
  const county: County = await locToCounty(33.5038, -112.0253); // latitude, longitude for Phoeinx
  // -> { county_name: "Maricopa", county_fips: "04013" }
})();

About

2018 US counties boundaries obtained from United States Census Bureau in Shapefile format. Shapefile was converted to GeoJson and downsampled to 10% of original size using mapshaper.

Readme

Keywords

none

Package Sidebar

Install

npm i @fuzzysaj/location-to-usa-county

Weekly Downloads

6

Version

1.0.6

License

GPL-3.0

Unpacked Size

6.01 MB

Total Files

45

Last publish

Collaborators

  • fuzzysaj