geo2zip | 🌎🔍 Quickly find the the nearest U
kandi X-RAY | geo2zip Summary
kandi X-RAY | geo2zip Summary
Quickly find the the nearest U.S. ZIP codes to a latitude/longitude geolocation using k-nearest neighbors. Takes a geolocation and returns the nearest US ZIP codes. ️ NOTE: The top result may not return the actual ZIP code containing the location. This library returns the ZIP code where the approximate center of the ZIP is nearest the given location. Larger ZIP code areas may show lower in the results when searching nearby points because the center can be so far away. If you're relying on something as inaccurate as ZIP codes, the top result is likely close enough. Also, ZIP codes change. They change in shape and location. New ones are created and old ones are removed. They're even recycled. If you know of a reliable, more up-to-date list of ZIP codes, please let us know by opening an issue. Can I use this in the browser? Yes but please don't. This is made to run on a Node.js server. This depends on a roughly 2 MB list of US ZIP codes and sorts those in-memory. Please don't do that to my phone. If you're experimenting or know what you're doing, use this wherever and however it works for you. Isn't sorting and filtering on a 2MB file slow in JavaScript? No. A lookup is created when the main file is imported/required. After the lookup is created, you should be able to run the examples in this README millions of times per second; showing output would be the limit. The tradeoff is your server may take a 1-2 seconds longer to start up initially (e.g. from npm run start).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of geo2zip
geo2zip Key Features
geo2zip Examples and Code Snippets
Community Discussions
Trending Discussions on geo2zip
QUESTION
I need to update this script to pass my key so that I don't go over the limit per day. How would I modify this script to pass my key?
(NOTE: google class information found here: https://developers.google.com/apps-script/reference/maps/geocoder)
...ANSWER
Answered 2019-Jun-13 at 14:46I believe your issue has more to do with the Google API management than with the scripts themselves. There is a way to limit how much your key is used. According to the Maps Platform documentation:
Manage Your Cost of Use
To manage your cost of use of the Google Maps Platform APIs, you can set daily limits to all requests to any billable API.
To view or change daily billable limits for the Geocoding API, do the following:
Go to the Geocoding API Quotas page in the Google Cloud Platform Console. From the projects list, select a project. In the Requests section, on the Requests per day line, click the edit icon, then enter the preferred total billable daily quota, up to the limit (if any) specified by Google.
You can basically set how many requests you want to allow per day, which will avoid you going over your limit.
UPDATE
You can link the script to your account using the Maps.setAuthentication(clientId, signingKey)
method, according to the docs, it:
Enables the use of an externally established Maps API for Business account, to leverage additional quota allowances. Your client ID and signing key can be obtained from the Google Enterprise Support Portal. Set these values to null to go back to using the default quota allowances.
Map Documentation Link: https://developers.google.com/apps-script/reference/maps/maps#setAuthentication(String,String)
Documentation URL: https://developers.google.com/maps/documentation/geocoding/usage-and-billing
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install geo2zip
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page