The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XML::Loy::GeoRSS - GeoRSS (Simple) Format Extension

SYNOPSIS

  use XML::Loy::Atom;

  my $atom = XML::Loy::Atom->new('entry');
  $atom->extension(-GeoRSS);

  my $geo = $atom->geo_where;
  $geo->geo_point(4.56, 5.67);

  say $geo->geo_point->[0];

DESCRIPTION

XML::Loy::GeoRSS is an extension for XML::Loy base classes and provides addititional functions for the work with geographic location as described in the specification. This represents the simple variant rather than the GML flavour.

This module is an early release! There may be significant changes in the future.

METHODS

XML::Loy::GeoRSS inherits all methods from XML::Loy and implements the following new ones.

geo_box

  # Add box
  $atom->geo_box(4, 5, 9, 8);
  $atom->geo_box(7, 8, 12, 15);

  say $atom->geo_box->[1]->[0];
  # 9

  say $atom->geo_box(1)->[1]->[0];
  # 12

Add box element based on two coordinates, or get box.

geo_circle

  # Add circle
  $atom->geo_circle(14.5, 20.4, 13);

  say $atom->geo_circle->[0]->[1];
  # 20.4

  say $atom->geo_circle->[1];
  # 13

Add circle element based on one coordinate and a value for radius, or get circle.

geo_elev

  $atom->geo_elev(40);

Add elev element.

geo_floor

  $atom->geo_floor(46);

Add floor element.

geo_line

  $atom->geo_line(45.34, -23.67, 16.3, 17.89);
  $atom->geo_line(45.34, -23.67, 16.3, 17.89, 15.4, 17.3);

  say $atom->geo_line->[0]->[0];
  # 45.34

  say $atom->geo_line(1)->[2]->[0];
  # 15.4

Add line element based on at least 2 coordinates, or get coordinates.

geo_point

  # Add point
  $atom->geo_point(4.56, 5.67);

  say $atom->geo_point->[0];
  # 4.56

Add point element based on one coordinate, or get it.

geo_polygon

  $atom->geo_polygon(45.34, -23.67, 16.3, 17.89, 15.4, 17.3);

  say $atom->geo_polygon->[2]->[0];
  # 15.4

Add polygon element based on at least 3 coordinates, or get coordinates.

geo_property

  $atom->geo_property(
    relationshiptag => 'test',
    featuretypetag  => [qw/foo bar/]
  );

Add geo features by means of relationshiptag, featuretypetag or featurename element.

geo_radius

  $atom->geo_radius(17);

Add radius element.

geo_where

  my $where = $atom->geo_where;
  $where->geo_point(4, 5);

Add where element.

DEPENDENCIES

Mojolicious.

AVAILABILITY

  https://github.com/Akron/XML-Loy

COPYRIGHT AND LICENSE

Copyright (C) 2011-2015, Nils Diewald.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl.