You are here

function _wkt_generate_multilinestring in Geofield 7

File

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

Code

function _wkt_generate_multilinestring() {
  $start = _random_point();
  $num = _dd_generate(1, 3, TRUE);
  $lines[] = _wkt_generate_linestring($start);
  for ($i = 0; $i < $num; $i += 1) {
    $diff = _random_point();
    $start[0] += $diff[0] / 100;
    $start[1] += $diff[1] / 100;
    $lines[] = _wkt_generate_linestring($start);
  }
  return '(' . implode('), (', $lines) . ')';
}