function _wkt_generate_multipolygon in Geofield 7
File
- ./
geofield.devel_generate.inc, line 153 - Create random data to populate geofields.
Code
function _wkt_generate_multipolygon() {
$start = _random_point();
$num = _dd_generate(1, 5, TRUE);
$segments = _dd_generate(2, 3, TRUE);
$poly[] = _wkt_generate_polygon($start, $segments);
for ($i = 0; $i < $num; $i += 1) {
$diff = _random_point();
$start[0] += $diff[0] / 100;
$start[1] += $diff[1] / 100;
$poly[] = _wkt_generate_polygon($start, $segments);
}
return '(' . implode(', ', $poly) . ')';
}