Open dryprogrammer opened 9 months ago
Hi @dryprogrammer and thanks for the input :)
Tbh, I was not expecting anyone to show interest in this package really, especially since the google code was lingering in their repository for close to a decade without anyone taking the effort to push it to pub.dev
For now https://pub.dev/documentation/open_location_code/latest/open_location_code/open_location_code-library.html provides a pretty good documentation. Once I feel like there are people start using the library and are in demand of a quick start guide, I will put some effort.
Please just give me a sign in form of a comment here, future users :)
Oh I hadn't seen that. I guess Perplexity crawled that for me when it generated the docs.
Right, I'm new to geohash on dart, but didn't see any mention of OLC for a decade, despite all the benefits and compatibility with Geocoding API out-of-the-box.
Hopefully somebody will understand the potential and extend this in the future. :)
Hi, just came across your package. I also mentioned it in https://github.com/google/open-location-code/issues/569
Maybe you can use the following as a start for some docs:
Open Location Code (OLC) Dart Library Documentation
The open_location_code package is a Dart library for working with Open Location Codes (OLCs), also known as "plus codes". It provides several functions for encoding, decoding, validating, and manipulating OLCs.
PlusCode
class: This is the main class for working with OLCs. It includes the following methods:PlusCode()
: Constructor for creating a newPlusCode
instance. It takes a string representing an OLC as an argument.PlusCode.unverified()
: Constructor for creating a newPlusCode
instance without verifying the validity of the OLC. It's intended for bulk processing where the codes are known to be valid.isValid()
: Checks if the OLC is valid.isShort()
: Determines if the OLC is a valid short code.isFull()
: Determines if the OLC is a valid full code.decode()
: Decodes an OLC into the location coordinates.recoverNearest()
: Recovers the nearest matching code to a specified location.shorten()
: Removes characters from the start of an OLC.encode()
: Encodes a location into an OLC.PlusCodeValidator
extension: This extension provides additional validation methods for thePlusCode
class.Constants: The file includes various constants used in the OLC encoding and decoding process, such as
pairResolutions
,gridColumns
,gridRows
,decodeTable
, and more.Helper functions: The file also includes helper functions used in the OLC encoding and decoding process.
PlusCode Class
The
PlusCode
class is the main class for working with OLCs. It includes the following methods:PlusCode()
This is the constructor for creating a new
PlusCode
instance. It takes a string representing an OLC as an argument.PlusCode.unverified()
This is a constructor for creating a new
PlusCode
instance without verifying the validity of the OLC. It's intended for bulk processing where the codes are known to be valid.isValid()
This method checks if the OLC is valid.
isShort()
This method determines if the OLC is a valid short code.
isFull()
This method determines if the OLC is a valid full code.
decode()
This method decodes an OLC into the location coordinates.
recoverNearest()
This method recovers the nearest matching code to a specified location.
shorten()
This method removes characters from the start of an OLC.
encode()
This method encodes a location into an OLC.
PlusCodeValidator Extension
The
PlusCodeValidator
extension provides additional validation methods for thePlusCode
class.Constants
The file includes various constants used in the OLC encoding and decoding process, such as
pairResolutions
,gridColumns
,gridRows
,decodeTable
, and more.Helper Functions
The file also includes helper functions used in the OLC encoding and decoding process.