| 1 |
<?php //$Id: views_handler_field_geo_data.inc,v 1.3 2009/03/03 02:16:28 vauxia Exp $ |
<?php //$Id: views_handler_field_geo_data.inc,v 1.4 2009/06/11 17:13:51 vauxia Exp $ |
| 2 |
|
|
| 3 |
class views_handler_field_geo_data extends content_handler_field_multiple { |
class views_handler_field_geo_data extends content_handler_field_multiple { |
| 4 |
function query() { |
function query() { |
| 9 |
} |
} |
| 10 |
|
|
| 11 |
// geo_field_select will return the SRID, Envelope, Centroid, and WKB data. |
// geo_field_select will return the SRID, Envelope, Centroid, and WKB data. |
| 12 |
$alias = $this->ensure_my_table() .'_'. $this->field; |
$func = geo('field_select', $geo_table . '.' . $this->real_field); |
| 13 |
$func = geo('field_select', $this->real_field, NULL, $target); |
$this->query->add_field('', $func, '', array('aggregate' => TRUE)); |
|
$this->query->add_field('', $func, $alias, array('aggregate' => TRUE)); |
|
| 14 |
|
|
| 15 |
foreach ($this->content_field['geo_data_value'] as $field) { |
foreach ($this->content_field['geo_data_value'] as $field) { |
| 16 |
$this->query->add_field($geo_table, $field); |
$this->query->add_field($geo_table, $field); |
| 36 |
|
|
| 37 |
$item['wkb'] = $values->{$geo_table.'_wkb'}; |
$item['wkb'] = $values->{$geo_table.'_wkb'}; |
| 38 |
$item['bbox'] = $values->{$geo_table.'_bbox'}; |
$item['bbox'] = $values->{$geo_table.'_bbox'}; |
| 39 |
|
$item['centroid'] = $values->{$geo_table.'_centroid'}; |
| 40 |
|
|
| 41 |
foreach ($this->content_field['geo_data_value'] as $column) { |
foreach ($this->content_field['geo_data_value'] as $column) { |
| 42 |
$value = $values->{$geo_table.'_'. $column}; |
$value = $values->{$geo_table.'_'. $column}; |