geo_query_functions

geo/geo.inc, line 71

Versions
6
geo_query_functions($geo_type)

Code

<?php
function geo_query_functions($geo_type) {
  $geo_type = strtolower($geo_type);
  $functions = array( 'wkt' => 'wkt', 'wkb' => 'wkb' );

  if ($geo_type == 'point') {
    $functions['lat'] = 'lat';
    $functions['lon'] = 'lon';
  }

  if ($geo_type == 'polygon' || $geo_type == 'linestring') {
    $functions['area'] = 'area';
    $functions['bbox'] = 'bbox';
    $functions['perimeter'] = 'perimeter';
  }

  if ($geo_type == 'linestring') {
    $functions['start'] = 'start';
    $functions['end'] = 'end';
  }

  // TODO distance? given that we have a starting point?

  return $functions;
}
?>