Net-API-Nominatim

 view release on metacpan or  search on metacpan

lib/Net/API/Nominatim.pm  view on Meta::CPAN

		},
		'debug' => {
			'verbosity' => 1,
			'cleanup' => 0,
		},
		'log' => {
			'logger-file' => undef,
		},
	  }
	};
	bless $self => $class;

	if( exists($params->{'verbosity'}) && defined($params->{'verbosity'}) ){
		$self->{'options'}->{'verbosity'} = $params->{'verbosity'}
	}
	my $verbosity = $self->verbosity();

	# WARNING: we are deleting items from user-supplie $params here, so we clone it

	# do we have a logger specified in params?
	if( exists($params->{'log'}->{'logger-file'}) && defined($params->{'log'}->{'logger-file'}) ){

lib/Net/API/Nominatim/Model/Address.pm  view on Meta::CPAN

		'name' => '',
		'type' => '',
		'place_rank' => '',
		'boundingbox' => undef,
		'category' => '',
		'addresstype' => '',
		'importance' => '',
		'display_name' => '',
		'licence' => '',
	};
	bless $self => $class;
	return $self unless defined $params;

	if( ref($params)eq'HASH' ){
		fromHash($params, $self);
	} elsif( ref($params)eq'' ){
		if( ! defined fromJSONHash($params, $self) ){ print STDERR __PACKAGE__."->new(), line ".__LINE__." : error, input JSON string was malformed, failed.\n"; return undef }
	} elsif( ref($params) eq __PACKAGE__ ){
		fromHash($params->toHash(), $self);
	}
	return $self;

lib/Net/API/Nominatim/Model/BoundingBox.pm  view on Meta::CPAN

### (whereas in Address.pm they are initialised to '', even lat/lon)
sub new {
	my ($class, $params) = @_;

	my $self = {
		lat1 => 0.0,
		lat2 => 0.0,
		lon1 => 0.0,
		lon2 => 0.0,
	};
	bless $self => $class;
	return $self unless defined $params;

	if( ref($params)eq'HASH' ){
		fromHash($params, $self);
	} elsif( ref($params)eq'' ){
		if( ! defined fromJSONArray($params, $self) ){ print STDERR __PACKAGE__."->new(), line ".__LINE__." : error, input JSON string was malformed, failed.\n"; return undef }
	} elsif( ref($params) eq __PACKAGE__ ){
		fromArray($params->toArray(), $self);
	} elsif( ref($params)eq'ARRAY' && scalar(@$params) && ref($params->[0])eq'ARRAY'){
		fromArrayOfArrays($params, $self);



( run in 1.910 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )