Geo-JSON

 view release on metacpan or  search on metacpan

lib/Geo/JSON/CRS.pm  view on Meta::CPAN


has type => (
    is       => 'ro',
    required => 1,
    isa      => sub {
        die "CRS type must be either 'name' or 'link'"
            unless $_[0] && ( $_[0] eq 'name' || $_[0] eq 'link' );
    },
);

has properties => ( is => 'ro', isa => HashRef, required => 1 );

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::CRS - Co-ordinate Reference System object

lib/Geo/JSON/Feature.pm  view on Meta::CPAN


has id => ( is => 'ro', isa => Maybe [Str] );

has geometry => (
    is       => 'ro',
    isa      => Geometry,
    coerce   => Geometry->coercion,
    required => 1
);

has properties => ( is => 'ro', isa => Maybe [HashRef] );

sub all_positions {
    return shift->geometry->all_positions;
}

1;

__END__

=encoding utf-8

lib/Geo/JSON/GeometryCollection.pm  view on Meta::CPAN

our $VERSION = '0.007';

use Moo;
extends 'Geo::JSON::Base';

use Carp;
use Types::Standard qw/ ArrayRef /;
use Geo::JSON::Types -types;

has geometries =>
    ( is => 'ro', isa => ArrayRef [Geometry], required => 1 );

sub all_positions {
    my $self = shift;

    return [ map { @{ $_->all_positions } } @{ $self->geometries } ];
}

1;

__END__



( run in 0.694 second using v1.01-cache-2.11-cpan-5f2e87ce722 )