The altitude in meters above the mean sea level.
The altitude attribute denotes the height of the position, specified in meters above the [WGS84] ellipsoid. If the implementation cannot provide altitude information, the value of this attribute must be null.

Comments

uzlov created an issue. See original summary.

uzlov’s picture

StatusFileSize
new7.91 KB
derjochenmeyer’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
Status: Active » Needs work

Shouldn't this patch implement hook_update_N?

uzlov’s picture

Status: Needs work » Needs review

I think, nope
for what? yes - we have changes in hook_field_schema
but after update we will have simply 0 for altitude value

'alt' => array(
'description' => 'Stores the altitude value',
'type' => 'float',
'size' => 'big',
'not null' => TRUE,
>>'default' => 0,
),

Status: Needs review » Needs work

The last submitted patch, 2: geolocation-add-altitude-2591607-0.patch, failed testing.

derjochenmeyer’s picture

What if you use 7.x-1.6 and want to use the "alt" value after an update? The the database field defaults to 0 but its not there in 7.x-1.6+? My understanding was that we need hook_update_N to create the altitude in all geolocation tables for existing installations.

Btw. maybe its better to name the column 'altitude' instead of 'alt' since it could be confused with image 'alt'?

<?php
/**
 * Add altitude field to geolocation tables.
 */
function mymodule_update_7103() {
  $fields = geolocation_get_geolocation_fields();

  foreach ($fields as $field) {
    $tables = array(_field_sql_storage_tablename($field), _field_sql_storage_revision_tablename($field));
    foreach ($tables as $table) {
      $spec = array(
        'description' => 'Stores the altitude value',
        'type' => 'float',
        'size' => 'big',
        'not null' => TRUE,
        'default' => 0,
      ); 
      db_add_field($table, 'altitude', $spec);
    }
  }
  return t(Added altitude field to geolocation tables.');
}
?>
derjochenmeyer’s picture

Status: Needs work » Needs review
StatusFileSize
new7.88 KB

Re-rolled patch.

Status: Needs review » Needs work

The last submitted patch, 7: geolocation-add-altitude-2591607-7.patch, failed testing.

derjochenmeyer’s picture

Status: Needs work » Needs review
StatusFileSize
new7.88 KB

Grr...

derjochenmeyer’s picture

StatusFileSize
new397 bytes
new7.88 KB

Grrr...

anthorn305’s picture

Sorry, ignore my comment, I need this for D8

christianadamski’s picture

Component: Geolocation field » Geolocation Field / Backend
Status: Needs review » Closed (won't fix)

Closing all 7.x issues. It's time.