README
NAME
Geo::Coder::OpenCage - Geocode addresses with the OpenCage Geocoder API
DESCRIPTION
This module provides an interface to the OpenCage geocoding service.
For full details on the API visit https://opencagedata.com.
SYNOPSIS
my $geocoder = Geo::Coder::OpenCage.new: api_key => $my_api_key;
my $result = $geocoder.geocode("Donostia");class Geo::Coder::OpenCage
That's the object you'll use to interface with the OpenCage API. It has a required attribute C, which you can obtain from http://geocoder.opencagedata.com.
method geocode
method geocode(
Str $place-name,
*%params
) returns Geo::Coder::OpenCage::ResponseThis method calls to the OpenCage API to obtain geocoding results for C<result = $geocoder.geocode( location => "Псковская улица, Санкт-Петербург, Россия", language => "ru", country => "rus", );
method reverse-geocode
method reverse-geocode(
Numeric $lat,
Numeric $lng,
*%params
) returns Geo::Coder::OpenCage::ResponseThis method, as the name suggests, call the API to obtain information about places existing under the specified coordinates (C<lng> for longtitude). Additional C<%params> can be passed according to the same rules as in the C<geocode()> method.
AUTHOR
Tadeusz Sośnierz
COPYRIGHT AND LICENSE
Copyright 2016 - 2017 Tadeusz Sośnierz
Copyright 2024 Raku Community
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.