Group
Extension

Matches 35359

Mojo-JSON-Any ( Y/YS/YSYROTA/Mojo-JSON-Any-0.990105.tar.gz, YSYROTA, 2015; MetaCPAN )
Mojo-JSON-Any/lib/Mojo/JSON/Any.pm ( view source; MetaCPAN )
kage Mojo::JSON::Any;

use strict;
use warnings;

our $VERSION = '0.990105';

use Mojo::JSON;

use constant JSONXS => ($ENV{MOJO_JSON})
  ? 0
  : eval { require JSON::XS; require Mojo::JSON::XS; 1 };
{ shift; JSONXS ? Mojo::JSON::XS->new(@_) : Mojo::JSON->new(@_) }

1;
__END__

=head1 NAME

Mojo::JSON::Any - Use JSON::XS when it's available (DEPRECATED)

=head1 SYNOPSIS

    use Mojo::JSON::Any;

    my $json   = Mojo::JSON::Any->new;
    my $string = $json->encode({foo => [1, 2], bar => 'hello!'});
    my $hash   = $json->decode('{"foo": [3, -2, 1]}');

=head1 DESCRIPTION

This modules is DEP
App-JSON-to ( D/DO/DOLMEN/App-JSON-to-1.000.tar.gz, DOLMEN, 2015; MetaCPAN )
App-JSON-to/lib/App/JSON/to/perl.pm ( view source; MetaCPAN )
use strict;
use warnings;

package App::JSON::to::perl;

our $VERSION = '1.000';

use Data::Dumper ();


sub dump
{
    my $data = $_[1];

    local $Data::Dumper::Indent = 0;
    local $Data::Dumper:
App-JSON-to ( D/DO/DOLMEN/App-JSON-to-1.000.tar.gz, DOLMEN, 2015; MetaCPAN )
App-JSON-to/lib/App/JSON/to.pm ( view source; MetaCPAN )
use strict;
use warnings;

package App::JSON::to;
# ABSTRACT: Convert JSON data to various formats

our $VERSION = '1.000';

use JSON::MaybeXS qw<decode_json>;

sub run
{
    my ($to, @args) = @_;
   
d $to;
    die "invalid target format '$to'\n"
	unless $to =~ /\A[a-z]+\z/ && eval { require "App/JSON/to/$to.pm"; 1 };
    my $class = __PACKAGE__ . '::' . $to;
    my $obj = $class->can('new') ? $cl
parse options
    # GetOptions($obj->options);

    binmode(STDIN, ':raw');
    my $data = decode_json do { local $/; <STDIN> };

    if (my $enc_meth = $obj->can('encoding')) {
	binmode(STDOUT, ':enc
App-JSON-to ( D/DO/DOLMEN/App-JSON-to-1.000.tar.gz, DOLMEN, 2015; MetaCPAN )
App-JSON-to/lib/App/JSON/to/yaml.pm ( view source; MetaCPAN )
use strict;
use warnings;

package App::JSON::to::yaml;

our $VERSION = '1.000';

use YAML::Tiny ();


sub encoding
{
    'UTF-8'
}

sub dump
{
    YAML::Tiny->new($_[1])->write_string
}

1;
Plack-Middleware-JSON ( F/FU/FUKAI/Plack-Middleware-JSON-0.01.tar.gz, FUKAI, 2015; MetaCPAN )
Plack-Middleware-JSON/lib/Plack/Middleware/JSON.pm ( view source; MetaCPAN )
kage Plack::Middleware::JSON;
use strict;
use warnings;
use parent qw/Plack::Middleware/;
use JSON::XS;
use URI::Escape;
our $VERSION = 0.01;

use Plack::Util::Accessor qw/json_key callback_key/;

sub
  if (defined $self->json_key) {
        my $json_key = $self->json_key() . '|' . $self->callback_key; 
        $self->json_key($json_key);
    }   
    else {
        $self->json_key($self->callback_
1]);
            my $json_key = $self->json_key;
            my $content_type = $h->get('Content-Type') || '';
            if (($json_key and $env->{QUERY_STRING} =~ /(?:^|&)($json_key)=([^&]+)/) or $
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Base.pm ( view source; MetaCPAN )
package Geo::JSON::Base;

our $VERSION = '0.007';

use Moo;
with 'Geo::JSON::Role::ToJson';

use Carp;

use Geo::JSON;
use Geo::JSON::Types -types;
use Geo::JSON::Utils;

use Types::Standard -types;

ercion );

has bbox => ( is => 'rw', isa => Maybe [ ArrayRef [Num] ] );

# used by JSON 'convert_blessed'
sub TO_JSON {
    my $self = $_[0];

    my %output = (
        type => $self->type,
        %
eo::JSON::Utils::compute_bbox( shift->all_positions );
}

sub all_positions {
    return shift->coordinates;
}

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::Base - Baseclass for Geo::JSON obj
Catalyst-Plugin-AutoCRUD ( O/OL/OLIVER/Catalyst-Plugin-AutoCRUD-2.200002.tar.gz, OLIVER, 2015; MetaCPAN )
Catalyst-Plugin-AutoCRUD/lib/Catalyst/Plugin/AutoCRUD/View/JSON.pm ( view source; MetaCPAN )
D::View::JSON;
{
  $Catalyst::Plugin::AutoCRUD::View::JSON::VERSION = '2.143070';
}

use strict;
use warnings;

use base 'Catalyst::View::JSON';

__PACKAGE__->config(
    expose_stash => 'json_data',
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Utils.pm ( view source; MetaCPAN )
package Geo::JSON::Utils;

our $VERSION = '0.007';

use strict;
use warnings;
use Carp;

use base 'Exporter';

our @EXPORT_OK = qw/ compare_positions compute_bbox /;

# TODO improve - need to ensure f
NAME

Geo::JSON::Utils - Util methods for Geo::JSON classes

=head1 SYNOPSIS

    use Geo::JSON::Utils qw/ compare_positions compute_bbox /;

=head1 DESCRIPTION

Util methods for L<Geo::JSON>

=head1 
METHODS

=head2 compare_positions

    if (Geo::JSON::Utils::compare_positions( $pt1, $pt2 )) {
        # positions of points are the same
    }

Compare two points. Compares in up to three dimensions
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Types.pm ( view source; MetaCPAN )
package Geo::JSON::Types;

our $VERSION = '0.007';

use strict;
use warnings;

BEGIN {
    use Type::Library -base, -declare => qw/
        CRS
        Feature
        Features
        Geometry
      
n
        Positions
        /;
    use Type::Utils;
    use Types::Standard -types;

    use Geo::JSON::Utils qw/ compare_positions /;

    declare Position,    #
        as ArrayRef [Num],    #
     
("Geo::JSON::Role::Geometry") };

    class_type CRS,      { class => 'Geo::JSON::CRS' };
    class_type Feature,  { class => 'Geo::JSON::Feature' };

    coerce CRS, from HashRef, q{ 'Geo::JSON::CRS'
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/MultiLineString.pm ( view source; MetaCPAN )
eo::JSON::MultiLineString;

our $VERSION = '0.007';

# ABSTRACT: object representing a geojson MultiLineString

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Geo::JSON::Ty
}

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::MultiLineString

=head1 SYNOPSIS

    use Geo::JSON::MultiLineString;
    my $mls = Geo::JSON::MultiLineString->new({
        coordinates => [ 
 ], ... ],
    });
    my $json = $mls->to_json;

=head1 DESCRIPTION

A GeoJSON object with a coordinates attribute of an arrayref of
arrayrefs of positions.

See L<Geo::JSON> for more details.

=cut
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Point.pm ( view source; MetaCPAN )
age Geo::JSON::Point;

our $VERSION = '0.007';

# ABSTRACT: object representing a geojson Point

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Carp;

use Geo::JSON::Types 
1 NAME

Geo::JSON::Point

=head1 SYNOPSIS

    use Geo::JSON::Point;
    my $pt = Geo::JSON::Point->new({
        coordinates => [ 51.50101, -0.14159 ],
    });
    my $json = $pt->to_json;

=head1 DE
SCRIPTION

A GeoJSON object with a coordinates attribute of a single position.

See L<Geo::JSON> for more details.

=cut

Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/GeometryCollection.pm ( view source; MetaCPAN )
package Geo::JSON::GeometryCollection;

our $VERSION = '0.007';

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

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

has geometries =>
    
-8

=head1 NAME

Geo::JSON::GeometryCollection - object representing a geojson GeometryCollection

=head1 SYNOPSIS

    use Geo::JSON::GeometryCollection;
    my $gcol = Geo::JSON::GeometryCollection-
>new({
        geometries => [ ... ],
    });
    my $json = $mpt->to_json;

=head1 DESCRIPTION

A GeoJSON object with a geometries attribute consisting of an arrayref of
Geometry objects (Point, Mult
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/FeatureCollection.pm ( view source; MetaCPAN )
ge Geo::JSON::FeatureCollection;

our $VERSION = '0.007';

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

use Carp;
use Types::Standard qw/ ArrayRef HashRef /;

use Geo::JSON::Types -types;
use Geo::JSON::Utils


Geo::JSON::FeatureCollection - object representing a geojson FeatureCollection

=head1 SYNOPSIS

    use Geo::JSON::FeatureCollection;
    
    # @feature_objects can be an array of Geo::JSON::Featu
 Geo::JSON::Feature objects.
    my $fcol = Geo::JSON::FeatureCollection->new({
         features => \@feature_objects,
    });
    
    my $json = $fcol->to_json;

=head1 DESCRIPTION

A GeoJSON objec
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/CRS.pm ( view source; MetaCPAN )
package Geo::JSON::CRS;

our $VERSION = '0.007';

use Moo;
with 'Geo::JSON::Role::ToJson';

use Types::Standard qw/ HashRef /;

use Geo::JSON;

has type => (
    is       => 'ro',
    required => 1,
 
oding utf-8

=head1 NAME

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

=head1 SYNOPSIS

    use Geo::JSON::CRS;
    
    # A named CRS
    my $wgs84 = Geo::JSON::CRS->new(
        {   type   
s are also possible, e.g. "urn:ogc:def:crs:EPSG::4326"
    
    # A linked CRS
    my $crs = Geo::JSON::CRS->new(
        {   type       => 'link',
            properties => {
                href => 
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Role/ToJson.pm ( view source; MetaCPAN )
package Geo::JSON::Role::ToJson;

our $VERSION = '0.007';

# ABSTRACT: Moo::Role providing to_json() methods for a geojson object

use Moo::Role;

sub to_json {
    my $self = shift;
    my $codec = s
:JSON::json;
    return $codec->encode($self);
}

# used by JSON 'convert_blessed'
sub TO_JSON {
    return { type => $_[0]->type, %{ $_[0] } };
}

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON
e::ToJson

=head1 DESCRIPTION

Provides the C<to_json> method.

=head1 METHODS

=head2 to_json

    $point->to_json();

    # or with custom JSON codec
    $point->to_json( $codec );

Returns JSON str
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Role/Geometry.pm ( view source; MetaCPAN )
package Geo::JSON::Role::Geometry;

our $VERSION = '0.007';

# ABSTRACT: Moo::Role representing behaviour of a geojson Geometry object

use Moo::Role;

use Types::Standard qw/ Any /;

has coordinates 
d1 NAME

Geo::JSON::Role::Geometry

=head1 DESCRIPTION

L<Moo::Role> for GeoJSON geometry objects (Point, MultiPoint, LineString,
MultiLineString, Polygon, MultiPolygon).

See L<Geo::JSON> for more de
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/MultiPoint.pm ( view source; MetaCPAN )
age Geo::JSON::MultiPoint;

our $VERSION = '0.007';

# ABSTRACT: object representing a geojson MultiPoint

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Geo::JSON::Types -
ons );

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::MultiPoint

=head1 SYNOPSIS

    use Geo::JSON::MultiPoint;
    my $mpt = Geo::JSON::MultiPoint->new({
        coordinates => [ [ 51.50101
         ],
    });
    my $json = $mpt->to_json;

=head1 DESCRIPTION

A GeoJSON object with a coordinates attribute consisting of an arrayref of
positions.

See L<Geo::JSON> for more details.

=cut

Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/Polygon.pm ( view source; MetaCPAN )
ackage Geo::JSON::Polygon;

our $VERSION = '0.007';

# ABSTRACT: object representing a geojson Polygon

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Geo::JSON::Types -typ
es } ];
}

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::Polygon

=head1 SYNOPSIS

    use Geo::JSON::Polygon;
    my $pg = Geo::JSON::Polygon->new({
        coordinates => [ [ 51.50101, -0.14
159 ], ... ],
                       [ [ 54.0, 0 ], ... ],
    });
    my $json = $pg->to_json;

=head1 DESCRIPTION

A GeoJSON object with a coordinates attribute of an arrayref of arrayrefs of
positi
Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/MultiPolygon.pm ( view source; MetaCPAN )
e Geo::JSON::MultiPolygon;

our $VERSION = '0.007';

# ABSTRACT: object representing a geojson MultiPolygon

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Geo::JSON::Types
;
}

1;

__END__

=encoding utf-8

=head1 NAME

Geo::JSON::MultiPolygon

=head1 SYNOPSIS

    use Geo::JSON::MultiPolygon;
    my $mpol = Geo::JSON::MultiPolygon->new({
        coordinates => [
      
        ],
        },
    });
    my $json = $mpol->to_json;

=head1 DESCRIPTION

A GeoJSON object with a coordinates of an arrayref of polygon coordinates.

See L<Geo::JSON> for more details.

=cut

Geo-JSON ( M/MJ/MJEMMESON/Geo-JSON-0.007.tar.gz, MJEMMESON, 2015; MetaCPAN )
Geo-JSON/lib/Geo/JSON/LineString.pm ( view source; MetaCPAN )
package Geo::JSON::LineString;

our $VERSION = '0.007';

use Moo;
extends 'Geo::JSON::Base';
with 'Geo::JSON::Role::Geometry';

use Geo::JSON::Types -types;

has '+coordinates' => ( isa => LineString 
=encoding utf-8

=head1 NAME

Geo::JSON::LineString - object representing a geojson LineString

=head1 SYNOPSIS

    use Geo::JSON::LineString;
    my $ls = Geo::JSON::LineString->new({
        coordi
101, -0.14159 ], ... ],
    });
    my $json = $ls->to_json;

=head1 DESCRIPTION

A GeoJSON object with a coordinates attribute of an arrayref of
positions.

See L<Geo::JSON> for more details.

=cut


Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.