_shp_get_record

geo/includes/shp2sql.inc, line 227

Versions
6
_shp_get_record(&$fp)

Code

<?php
function _shp_get_record(&$fp) {
  if (!$row_header = zip_entry_read($fp, 12)) return FALSE;

  $row = unpack('Nnumber/Nlength/igeo_type', $row_header);
  $row['geo_type'] = _shp_geo_types($row['geo_type']);

  // Look for _shp_get_point(), _shp_get_linestring(), etc.
  if (!function_exists($func = '_shp_get_'. $row['geo_type'])) {
    drupal_set_message(t('Unsupported geo type %type found in file.', array('%type' =>  $row['geo_type'])), 'error');
    return FALSE;
  }

  $row['data'] = $func($fp);
  return $row;
}
?>