1 | <?php |
||
25 | class Util |
||
26 | { |
||
27 | private static $little_endian = null; |
||
28 | |||
29 | private static $shape_names = array( |
||
30 | 0 => 'Null Shape', |
||
31 | 1 => 'Point', |
||
32 | 3 => 'PolyLine', |
||
33 | 5 => 'Polygon', |
||
34 | 8 => 'MultiPoint', |
||
35 | 11 => 'PointZ', |
||
36 | 13 => 'PolyLineZ', |
||
37 | 15 => 'PolygonZ', |
||
38 | 18 => 'MultiPointZ', |
||
39 | 21 => 'PointM', |
||
40 | 23 => 'PolyLineM', |
||
41 | 25 => 'PolygonM', |
||
42 | 28 => 'MultiPointM', |
||
43 | 31 => 'MultiPatch', |
||
44 | ); |
||
45 | |||
46 | /** |
||
47 | * Reads data. |
||
48 | * |
||
49 | * @param string $type type for unpack() |
||
50 | * @param string $data Data to process |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | 23 | public static function loadData($type, $data) |
|
63 | |||
64 | /** |
||
65 | * Changes endianity. |
||
66 | * |
||
67 | * @param string $binValue Binary value |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | 1 | public static function swap($binValue) |
|
80 | |||
81 | /** |
||
82 | * Encodes double value to correct endianity. |
||
83 | * |
||
84 | * @param float $value Value to pack |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | 13 | public static function packDouble($value) |
|
102 | |||
103 | /** |
||
104 | * Returns shape name. |
||
105 | * |
||
106 | * @param int $type |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | 1 | public static function nameShape($type) |
|
118 | } |
||
119 |