|
|
@@ -2,7 +2,15 @@
|
|
|
|
|
|
class Complex {
|
|
|
private $real = 0;
|
|
|
- private $imag = 0;
|
|
|
+ private $imag = 0;
|
|
|
+
|
|
|
+ public function __debugInfo() {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function __invoke() {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
public function __construct($real = 0, $imag = 0) {
|
|
|
if ($real instanceof Complex) {
|
|
|
@@ -328,7 +336,13 @@ class EpsgConversion {
|
|
|
public static function GetZByEpsg2180($x, $y) {
|
|
|
if (!(is_numeric($x) && is_numeric($y))) throw new Exception('Bad argument(s)');
|
|
|
$table = 'CODGIK_NMT_100_EPSG2180';
|
|
|
- $query = "select x(`the_geom`) as `x`, y(`the_geom`) as `y`, `z` from `{$table}` where abs(x(`the_geom`) - {$x}) < 100 and abs(y(`the_geom`) - {$y}) < 100";
|
|
|
+ //$query = "select x(`the_geom`) as `x`, y(`the_geom`) as `y`, `z` from `{$table}` where abs(x(`the_geom`) - {$x}) < 100 and abs(y(`the_geom`) - {$y}) < 100";
|
|
|
+ $x1 = round(floor($x / 100) * 100);
|
|
|
+ $x2 = round(ceil($x / 100) * 100);
|
|
|
+ $y1 = round(floor($y / 100) * 100);
|
|
|
+ $y2 = round(ceil($y / 100) * 100);
|
|
|
+ $query = "select `x`, `y`, `z` from `{$table}` where (`x` = {$x1} and `y` = {$y1}) or (`x` = {$x1} and `y` = {$y2}) or (`x` = {$x2} and `y` = {$y1}) or (`x` = {$x2} and `y` = {$y2})";
|
|
|
+
|
|
|
try {
|
|
|
$result = DB::getPDO()->fetchAll($query);
|
|
|
} catch (Exception $e) {
|