NAME

Geo::JSON::Simple - Simplified functions for generating Geo::JSON objects

VERSION

version 0.001

SYNOPSIS

use Geo::JSON::Simple;

my $point = point(qw( 1.1 1.1 ));
$point->to_json; # See Geo::JSON->to_json

# all functions generate several points out of a list
multipoint(qw( 1.1 1.1 2.2 2.2 ));

# polygon don't need the first element repeated at the end
polygon([qw( 100.0 0.0 101.0 0.0 101.0 1.0 100.0 1.0 )]);

collection(
  point(qw( 1.1 1.1 )), linestring(qw( 2.2 2.2 3.3 3.3 1.3 1.3 ))
);

feature point(qw( 717862.48638976 6648347.0162409 )),
  gold_amount => 23,
  data => "Here is the gold";

geometrycollection(
  point(qw( 34 55 )), player => 1,
  point(qw( 56 15 )), player => 2,
  point(qw( 87 33 )), player => 3,
  point(qw( 11 23 )), player => 4
);

from_geo_json($json); # Shortcut to Geo::JSON->from_json

DESCRIPTION

This module gives an easy access to Geo::JSON. You can generate complex Geo::JSON object structures with simple commands. It also is a bit practical orientated to avoid boilerplate in your code. More magic is upcoming (but not much as far as I can see what is possible).

FUNCTIONS

point

Returns a Geo::JSON::Point.

multipoint

Returns a Geo::JSON::MultiPoint.

linestring

Returns a Geo::JSON::LineString.

multilinestring

Returns a Geo::JSON::MultiLineString.

polygon

Returns a Geo::JSON::Polygon.

multipolygon

Returns a Geo::JSON::MultiPolygon.

feature

Returns a Geo::JSON::Feature.

featurecollection

Returns a Geo::JSON::FeatureCollection.

geometrycollection

Returns a Geo::JSON::GeometryCollection.

from_geo_json

Shortcut to "from_json" in Geo::JSON.

SEE ALSO

Geo::JSON
http://geojson.org/

SUPPORT

IRC

Join #duckduckgo on irc.freenode.net. Highlight Getty for fast reaction :).

Repository

http://github.com/Getty/p5-geo-json-simple
Pull request and additional contributors are welcome

Issue Tracker

http://github.com/Getty/p5-geo-json-simple/issues

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.