| 1 |
<?php // $Id: geo_field.module,v 1.21 2009/06/10 23:28:36 vauxia Exp $ |
<?php // $Id: geo_field.module,v 1.22 2009/06/18 01:24:11 vauxia Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 38 |
); |
); |
| 39 |
|
|
| 40 |
// TODO pick the SRID for this column |
// TODO pick the SRID for this column |
| 41 |
if (!isset($field['srid'])) $field['srid'] = GEO_SRID_DEFAULT; |
if (!$field['srid']) $field['srid'] = GEO_SRID_DEFAULT; |
| 42 |
$form['srid'] = array('#type' => 'value', '#value' => $field['srid']); |
$form['srid'] = array('#type' => 'value', '#value' => $field['srid']); |
| 43 |
|
|
| 44 |
return $form; |
return $form; |
| 141 |
// Convert the wkt to binary data before the insert. This allows the |
// Convert the wkt to binary data before the insert. This allows the |
| 142 |
// input to pass through the binary query substitutions. |
// input to pass through the binary query substitutions. |
| 143 |
if(!geo_content_is_empty($item, $field)) { |
if(!geo_content_is_empty($item, $field)) { |
| 144 |
$item['geo'] = db_result(db_query("SELECT GeomFromText('%s', %d)", $item['geo'], $item['srid'])); |
$item['geo'] = db_result(db_query("SELECT GeomFromText('%s', %d)", $item['geo'], $field['srid'])); |
| 145 |
} |
} |
| 146 |
$items[$k] = $item; |
$items[$k] = $item; |
| 147 |
} |
} |