微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Perl GeoNames Client

程序名称:Perl GeoNames Client

授权协议: Artistic License/GPL

操作系统: Windows

开发语言: Perl

Perl GeoNames Client 介绍

Perl GeoNames Client 是 GeoNames 的 Perl 语言客户端开发包。

示例代码

  use Geo::GeoNames;
  use Data::Dumper;
  my $geo = new Geo::GeoNames();

  # make a query based on placename
  my $result = $geo->search(q => 'Fredrikstad', maxRows => 2);

  # print the first result
  print " Name: " . $result->[0]->{name};
  print " Longitude: " . $result->[0]->{lng};
  print " Lattitude: " . $result->[0]->{lat};

  # Dump the data structure into readable form
  # This also will show the attributes to each found location
  Data::Dumper->Dump()

  # Make a query based on postcode
  $result = $geo->postalcode_search(postalcode => "1630", maxRows => 3, style => "FULL");

Perl GeoNames Client 官网

http://search.cpan.org/~perhenrik/Geo-GeoNames/lib/Geo/GeoNames.pm

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐