GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Astro::App::Satpass2::Geocode(3) User Contributed Perl Documentation Astro::App::Satpass2::Geocode(3)

Astro::App::Satpass2::Geocode - Abstract geocoding wrapper class.

 # Assuming Astro::App::Satpass2::Geocode::OSM is a
 # subclass of this class,
 
 use Astro::App::Satpass2::Geocode::OSM;
 use YAML;
 
 my $geocoder = Astro::App::Satpass2::Geocode::OSM->new();
 print Dump( $geocoder->geocode(
     '1600 Pennsylvania Ave, Washington DC'
 ) );

This class is an abstract wrapper for "Astro::App::Satpass2" geocoding functionality. It may not be instantiated directly.

The purpose of the wrapper is to provide a consistent interface to the various "Geo::Coder::*" modules that provide geocoding services.

This class is a subclass of Astro::App::Satpass2::Copier.

This class supports the following public methods in addition to those provided by its superclass:

 # Assuming Astro::App::Satpass2::Geocode::OSM is a subclass
 # of this class,
 my $geocoder = Astro::App::Satpass2::Geocode::OSM->new();

This static method instantiates a new geocoder object. It may not be called on this class.

This method takes arguments as name/value pairs. The supported arguments are geocoder and warner, which correspond to the same-named mutators.

 my @rslt = $geocoder->geocode(
     '1600 Pennsylvania Ave, Washington DC',
 );

This method must be overridden by any subclass. The subclass must not call "$self->SUPER::geocode".

This method geocodes the given location, using the underlying geocoder object, and returns any results found. The result is an array of hash references, each hash representing one location. The hashes must have the following keys:

description
This is a description of the location. It is expected to be an address derived from the information returned by the geocoder.
latitude
This is the latitude of the location, in degrees, with south latitude negative.
longitude
This is the longitude of the location, in degrees, with west longitude negative.

 $geocoder->geocoder(
     Geo::Coder::OSM->new(),
 );
 my $gc = $geocoder->geocoder();

This method is an accessor/mutator to the underlying geocoder object.

If called with no arguments, it simply returns the underlying geocoder object.

If called with arguments, it sets the geocoder object. The argument must be either "undef", a class name, or an object. If a class name, the class is instantiated. If "undef", the default class is instantiated. In any event, the object must be a subclass of the default class.

 say 'Geocoder class is ', $geocoder->GEOCODER_CLASS;

This method must be overridden by any subclass. It may be implemented by "use constant". The override must support being called as either a static or a normal method.

This method specifies the name of the underlying geocoder class.

 say 'Geocoder site is ', $geocoder->GEOCODER_SITE;

This method must be overridden by any subclass. It may be implemented by "use constant". The override must support being called as either a static or a normal method.

This method specifies the URL of the web site providing the service. It is intended to be used to probe the web site for availability.

Support is by the author. Please file bug reports at <https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-App-Satpass2>, <https://github.com/trwyant/perl-Astro-App-Satpass2/issues>, or in electronic mail to the author.

Thomas R. Wyant, III wyant at cpan dot org

Copyright (C) 2011-2021 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

2021-11-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.