GeolocationGeometryIntersects.php in Geolocation Field 8.3
File
modules/geolocation_geometry/src/Plugin/views/join/GeolocationGeometryIntersects.php
View source
<?php
namespace Drupal\geolocation_geometry\Plugin\views\join;
use Drupal\views\Plugin\views\join\JoinPluginBase;
use Drupal\views\Plugin\views\join\JoinPluginInterface;
class GeolocationGeometryIntersects extends JoinPluginBase implements JoinPluginInterface {
public function buildJoin($select_query, $table, $view_query) {
$geometry_field = ($table['alias'] ?: $this->table) . '.' . $this->field . '_geometry';
$within_field = $this->leftTable . '.' . $this->leftField . '_geometry';
$condition = 'ST_Intersects(' . $within_field . ', ' . $geometry_field . ')';
$select_query
->addJoin($this->type, $this->table, $table['alias'], $condition);
}
}