You are here

function _wkt_generate_multipoint in Geofield 7

File

./geofield.devel_generate.inc, line 103
Create random data to populate geofields.

Code

function _wkt_generate_multipoint() {
  $num = _dd_generate(1, 5, TRUE);
  $start = _random_point();
  $points[] = _wkt_generate_point($start);
  for ($i = 0; $i < $num; $i += 1) {
    $diff = _random_point();
    $start[0] += $diff[0] / 100;
    $start[1] += $diff[1] / 100;
    $points[] = _wkt_generate_point($start);
  }
  return implode(', ', $points);
}