Wikibase::Datatype::Value::Globecoordinate - Wikibase globe coordinate value datatype.
use Wikibase::Datatype::Value::Globecoordinate; my $obj = Wikibase::Datatype::Value::Globecoordinate->new(%params); my $altitude = $obj->altitude; my $globe = $obj->globe; my $latitude = $obj->latitude; my $longitude = $obj->longitude; my $precision = $obj->precision; my $type = $obj->type; my $value = $obj->value;
This datatype is globecoordinate class for representation of coordinate.
new
my $obj = Wikibase::Datatype::Value::Globecoordinate->new(%params);
Constructor.
Returns instance of object.
altitude
Altitude. Parameter is optional. Default value is undef.
globe
Globe entity. Parameter is optional. Default value is 'Q2'.
precision
Coordinate precision. Parameter is optional. Default value is '1e-07'.
value
Value of instance. Parameter is required.
my $altitude = $obj->altitude;
Get altitude.
Returns TODO
my $globe = $obj->globe;
Get globe. Unit is entity (e.g. /^Q\d+$/).
Returns string.
latitude
my $latitude = $obj->latitude;
Get latitude.
Returns number.
longitude
my $longitude = $obj->longitude;
Get longitude.
my $precision = $obj->precision;
Get precision.
type
my $type = $obj->type;
Get type. This is constant 'string'.
my $value = $obj->value;
Get value.
new(): From Wikibase::Datatype::Utils::check_entity(): Parameter 'globe' must begin with 'Q' and number after it. From Wikibase::Datatype::Value::new(): Parameter 'value' is required. Parameter 'value' array must have two fields (latitude and longitude). Parameter 'value' has bad first parameter (latitude). Parameter 'value' has bad first parameter (longitude). Parameter 'value' must be a array.
use strict; use warnings; use Wikibase::Datatype::Value::Globecoordinate; # Object. my $obj = Wikibase::Datatype::Value::Globecoordinate->new( 'value' => [49.6398383, 18.1484031], ); # Get globe. my $globe = $obj->globe; # Get longitude. my $longitude = $obj->longitude; # Get latitude. my $latitude = $obj->latitude; # Get precision. my $precision = $obj->precision; # Get type. my $type = $obj->type; # Get value. my $value_ar = $obj->value; # Print out. print "Globe: $globe\n"; print "Latitude: $latitude\n"; print "Longitude: $longitude\n"; print "Precision: $precision\n"; print "Type: $type\n"; print 'Value: '.(join ', ', @{$value_ar})."\n"; # Output: # Globe: Q2 # Latitude: 49.6398383 # Longitude: 18.1484031 # Precision: 1e-07 # Type: globecoordinate # Value: 49.6398383, 18.1484031
Error::Pure, Mo, Wikibase::Datatype::Utils, Wikibase::Datatype::Value.
Wikibase datatypes.
Wikibase globe coordinate value pretty print helpers.
https://github.com/michal-josef-spacek/Wikibase-Datatype
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2020-2023 Michal Josef Špaček
BSD 2-Clause License
0.33
To install Wikibase::Datatype, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wikibase::Datatype
CPAN shell
perl -MCPAN -e shell install Wikibase::Datatype
For more information on module installation, please visit the detailed CPAN module installation guide.