add Geo::Coder::Bing to geosort application module user/lew/geosort-bing
authorLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Thu, 14 Jul 2022 19:15:58 +0000 (15:15 -0400)
committerLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Wed, 19 Oct 2022 14:25:53 +0000 (10:25 -0400)
Signed-off-by: Llewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/extras/install/Makefile.debian-buster
Open-ILS/src/extras/install/Makefile.debian-jessie
Open-ILS/src/extras/install/Makefile.debian-stretch
Open-ILS/src/extras/install/Makefile.fedora
Open-ILS/src/extras/install/Makefile.ubuntu-bionic
Open-ILS/src/extras/install/Makefile.ubuntu-focal
Open-ILS/src/perlmods/lib/OpenILS/Application/Geo.pm

index 5c8ff08..0c1f29b 100644 (file)
@@ -97,6 +97,7 @@ export DEB_APACHE_DISCONF = \
 
 export CPAN_MODULES = \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Business::OnlinePayment::PayPal \
        String::KeyboardDistance \
        Text::Levenshtein::Damerau::XS \
index 545a1a5..346d779 100644 (file)
@@ -97,6 +97,7 @@ export DEB_APACHE_DISCONF = \
 
 export CPAN_MODULES = \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Business::OnlinePayment::PayPal \
        String::KeyboardDistance \
        Text::Levenshtein::Damerau::XS \
index 48ba5a6..37a427c 100644 (file)
@@ -97,6 +97,7 @@ export DEB_APACHE_DISCONF = \
 
 export CPAN_MODULES = \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Business::OnlinePayment::PayPal \
        String::KeyboardDistance \
        Text::Levenshtein::Damerau::XS \
index 907bd99..2d1bb99 100644 (file)
@@ -74,6 +74,7 @@ FEDORA_RPMS = \
 export CPAN_MODULES = \
        Geo::Coder::OSM \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Excel::Writer::XLSX \
        String::KeyboardDistance \
        Text::Levenshtein::Damerau::XS \
index 6a64765..f0231a7 100644 (file)
@@ -93,6 +93,7 @@ export DEB_APACHE_DISCONF = \
 
 export CPAN_MODULES = \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Business::OnlinePayment::PayPal \
        Email::Send \
        MARC::Charset \
index 9ebe327..df5ed76 100644 (file)
@@ -93,6 +93,7 @@ export DEB_APACHE_DISCONF = \
 
 export CPAN_MODULES = \
        Geo::Coder::Google \
+       Geo::Coder::Bing \
        Business::OnlinePayment::PayPal \
        Email::Send \
        MARC::Charset \
index 3f735e5..173b9e6 100644 (file)
@@ -23,6 +23,7 @@ my $have_geocoder_free = eval {
 };
 use Geo::Coder::OSM;
 use Geo::Coder::Google;
+use Geo::Coder::Bing;
 
 use Math::Trig qw(great_circle_distance deg2rad);
 use Digest::SHA qw(sha256_base64);
@@ -178,6 +179,9 @@ sub retrieve_coordinates { # invoke 3rd party API for latitude/longitude lookup
         } elsif ($service->service_code eq 'Google') {
             $logger->debug("Using Geo::Coder::Google (service id $service_id)");
             $geo_coder = Geo::Coder::Google->new(key => $service->api_key);
+        } elsif ($service->service_code eq 'Bing') {
+            $logger->debug("Using Geo::Coder::Bing (service id $service_id)");
+            $geo_coder =  Geo::Coder::Bing->new(key => $service->api_key);
         } else {
             $logger->debug("Using Geo::Coder::OSM (service id $service_id)");
             $geo_coder = Geo::Coder::OSM->new();
@@ -204,6 +208,9 @@ sub retrieve_coordinates { # invoke 3rd party API for latitude/longitude lookup
     } elsif ($service->service_code eq 'Google') {
        $latitude = $location->{'geometry'}->{'location'}->{'lat'};
        $longitude = $location->{'geometry'}->{'location'}->{'lng'};
+    } elsif ($service->service_code eq 'Bing') {
+       $latitude = $location->{point}{coordinates}[0];
+       $longitude = $location->{point}{coordinates}[1];
     } else {
        $latitude = $location->{lat};
        $longitude = $location->{lon};