Completed
Push — master ( 211857...11662a )
by Maxime
07:33 queued 03:39
created

Lookup::osmIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Class Lookup
4
 *
5
 * @package      maxh\nominatim
6
 * @author       Maxime Hélias <[email protected]>
7
 */
8
9
namespace maxh\Nominatim;
10
11
use maxh\Nominatim\Exceptions\InvalidParameterException;
12
13
/**
14
 * Lookup the address of one or multiple OSM objects like node, way or relation. 
15
 *
16
 * @see http://wiki.openstreetmap.org/wiki/Nominatim
17
 */
18
class Lookup extends Query
19
{
20
21
	/**
22
	 * Constuctor
23
	 * @param array $query Default value for this query
24
	 */
25
	public function __construct(array $query = [])
26
	{
27
		parent::__construct();
28
29
		$this->setPath('lookup');
30
	}
31
32
	// -- Builder methods ------------------------------------------------------
33
34
	/**
35
	 * A list of up to 50 specific osm node, way or relations ids to return the addresses for
36
	 * 
37
	 * @param  string $id
38
	 * 
39
	 * @return maxh\Nominatim\Lookup
40
	 */
41
	public function osmIds($id)
42
	{
43
		$this->query['osm_ids'] = $id;
44
45
		return $this;
46
	}
47
48
	/**
49
	 * Output format for the geometry of results
50
	 * 
51
	 * @param  string $polygon
52
	 * 
53
	 * @throws maxh\Nominatim\Exceptions\InvalidParameterException  Polygon is not supported with lookup
54
	 */
55
	public function polygon($polygon)
56
	{
57
		throw new InvalidParameterException("The polygon is not supported with lookup");
58
	}
59
60
61
}
62