B4A Library [B4X] PlusCodes Library



This is an implementation of the Open Location Code, OLC, library in B4X.
The class source is an adaption of the VBA source provided on GITBUB VBA Source

I stay these days in rural province area, common postal addresses are not a given, usually the nick name is sufficient for a village.
For example, in the time of Covid and travel restrictions, the number of online orders are grown up.
Delivery of online orders by services from outside not familiar with the village run into a time problem, houses in satellite areas are difficult to find.
The PlusCodes attached to the delivery addresses are often helpful in the last month, specially to deliver in satellite areas with minimum time delay.
I implement the PlusCodes in an B4A and B4J application for support. The library decode and encode PlusCodes addresses in longitude and latitude coordinates with given accuracy.
The coordinates are WGS84 compatible and can be used with other application. BTW Google Maps support PlusCodes Addresses directly.

I implemented OLC as standard class. So before use the class must be initialized.

For example running the test procedures

B4X:
            Private PC As PlusCode
            PC.Initialize
            PC.TestOLCLibrary

I modified the code where necessary (string operation in most cases) and changed the MSGBOX calls to LOG and LOGERROR in case of B4J specially in the included test routine
I did not test the library with B4I. There are no UI elements and the source code does not include platform relevant instructions.

The following ist part of the GITHUB Documentation....


Part of the library source is the protocol of the test run

Any improvements of library or comments are welcome
I have a weak internet connection here, so can happen I will answer delayed

Version 210821.01 is attached
 

Attachments

  • PlusCode.b4xlib
    17.2 KB · Views: 282
Cookies are required to use this site. You must accept them to continue using the site. Learn more…