Skip to content

Commit

Permalink
Merge branch 'bug/mysql-functions'
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-et-al committed May 19, 2021
2 parents 9bed14d + ac411d8 commit e27de89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions helpers/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function nl_setGeometry($coverage)
{
$coverage_or_default = $coverage ?: "POINT(0 0)";
return new Zend_Db_Expr("COALESCE(
GeomFromText('{$coverage_or_default}'), GeomFromText('POINT(0 0)')
ST_GeomFromText('{$coverage_or_default}'), ST_GeomFromText('POINT(0 0)')
)");
}

Expand All @@ -32,5 +32,5 @@ function nl_setGeometry($coverage)
*/
function nl_getGeometry($column)
{
return new Zend_Db_Expr('NULLIF(AsText(coverage), "POINT(0 0)")');
return new Zend_Db_Expr('NULLIF(ST_AsText(coverage), "POINT(0 0)")');
}
2 changes: 1 addition & 1 deletion models/NeatlineRecordTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected function filterExtent()
$bb = $this->params['extent'];

$this->select->where(
"MBRIntersects(coverage, GeomFromText(?)) OR
"MBRIntersects(coverage, ST_GeomFromText(?)) OR
is_wms = 1", $bb // Always match WMS layers.
);

Expand Down

0 comments on commit e27de89

Please sign in to comment.