.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Geo::Coder::OSM 3pm" .TH Geo::Coder::OSM 3pm "2019-02-18" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Geo::Coder::OSM \- Geocode addresses with the OpenStreetMap Nominatim API .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Geo::Coder::OSM; \& \& my $geocoder = Geo::Coder::OSM\->new; \& my $location = $geocoder\->geocode( \& location => \*(AqHollywood and Highland, Los Angeles, CA\*(Aq \& ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`Geo::Coder::OSM\*(C'\fR module provides an interface to the OpenStreet Nominatim geocoding service. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 6 \& $geocoder = Geo::Coder::OSM\->new() \& $geocoder = Geo::Coder::OSM\->new( \& ua => $ua, \& sources => [ \*(Aqosm\*(Aq, \*(Aqmapquest\*(Aq ], \& debug => 1, \& ) .Ve .PP Creates a new geocoding object. .PP Accepts an optional \fBua\fR parameter for passing in a custom LWP::UserAgent object. .PP Accepts an optional \fBsources\fR parameter for specifying the data sources. Current valid values are \fBosm\fR and \fBmapquest\fR. The default value is \fBosm\fR. To cycle between different sources, specify an array reference for the \&\fBsources\fR value. To define additional sources, see \*(L"\s-1SOURCES\*(R"\s0 below. .SS "geocode" .IX Subsection "geocode" .Vb 2 \& $location = $geocoder\->geocode(location => $location) \& @locations = $geocoder\->geocode(location => $location) .Ve .PP In scalar context, this method returns the first location result; and in list context it returns all location results. .PP Each location result is a hashref; a typical example looks like: .PP .Vb 10 \& { \& address => { \& city => "Los Angeles", \& country => "United States of America", \& country_code => "us", \& hamlet => "Hollywood", \& road => "Hollywood Boulevard", \& station => "Hollywood/Highland", \& suburb => "Little Armenia", \& }, \& boundingbox => [ \& "34.101634979248", "34.1018371582031", \& "\-118.339317321777", "\-118.33910369873", \& ], \& class => "railway", \& display_name => \& "Hollywood/Highland, Hollywood Boulevard, Little Armenia, Hollywood, Los Angeles, United States of America", \& icon => \& "http://nominatim.openstreetmap.org/images/mapicons/transport_train_station2.p.20.png", \& lat => "34.101736", \& licence => \& "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC\-BY\-SA 2.0.", \& lon => "\-118.33921", \& osm_id => 472413621, \& osm_type => "node", \& place_id => 9071654, \& type => "station", \& } .Ve .SS "reverse_geocode" .IX Subsection "reverse_geocode" .Vb 2 \& $location = $geocoder\->reverse_geocode(lat => $lat, lon => $lon) \& $location = $geocoder\->reverse_geocode(latlng => "$lat,$lon") .Ve .PP Returns a location result for the given lat/lon pair. .SS "response" .IX Subsection "response" .Vb 1 \& $response = $geocoder\->response() .Ve .PP Returns an HTTP::Response object for the last submitted request. Can be used to determine the details of an error. .SS "ua" .IX Subsection "ua" .Vb 2 \& $ua = $geocoder\->ua() \& $ua = $geocoder\->ua($ua) .Ve .PP Accessor for the UserAgent object. .SS "\s-1SOURCES\s0" .IX Subsection "SOURCES" To define additional sources add them to the \fB\f(CB%SOURCES\fB\fR package variable like so: .PP .Vb 2 \& $Geo::Coder::OSM::SOURCES{local} = \*(Aqhttp://127.0.0.1/api_base_path\*(Aq; \& $Geo::Coder::OSM::SOURCES{internal} = \*(Aqhttp://internal.corp/api_base_path\*(Aq; .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .PP .SH "REQUESTS AND BUGS" .IX Header "REQUESTS AND BUGS" Please report any bugs or feature requests to . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc Geo::Coder::OSM .Ve .PP You can also look for information at: .IP "\(bu" 4 GitHub Source Repository .Sp .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2010\-2013 gray , all rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" gray,