org.geolatte.geom.generator.GeometryGenerators Maven / Gradle / Ivy
Show all versions of geolatte-geom Show documentation
package org.geolatte.geom.generator;
import org.geolatte.geom.*;
import java.util.List;
import java.util.Random;
import static java.util.Arrays.asList;
/**
* Created by Karel Maesen, Geovise BVBA on 03/08/2018.
*/
public class GeometryGenerators {
public static Generator> combine
(final Random rnd, final List>> generators) {
return new CombinedGeometryGenerator<>(rnd, generators);
}
public static Generator> combine
(final List>> generators) {
return new CombinedGeometryGenerator<>(new Random(), generators);
}
public static Generator> point(Box bbox) {
return new DefaultPointGenerator<>(bbox, new Random());
}
public static
Generator> point(Box bbox, Random rnd) {
return new DefaultPointGenerator<>(bbox, rnd);
}
public static
Generator> lineString(int numPnts, Box bbox,
Random rnd) {
return new DefaultLineStringGenerator<>(numPnts, bbox, rnd);
}
public static
Generator> lineString(int numPnts, Box bbox) {
return new DefaultLineStringGenerator<>(numPnts, bbox, new Random());
}
public static
Generator> polygon(int numPnts, Box bbox,
Random rnd) {
return new DefaultPolygonGenerator<>(numPnts, bbox, rnd);
}
public static
Generator> polygon(int numPnts, Box bbox) {
return new DefaultPolygonGenerator<>(numPnts, bbox, new Random());
}
public static
Generator> multiPoint(int numPnts, Box bbox,
Random rnd) {
return new DefaultMultiPointGenerator<>(numPnts, bbox, rnd);
}
public static
Generator> multiPoint(int numPnts, Box bbox) {
return new DefaultMultiPointGenerator<>(numPnts, bbox, new Random());
}
public static
Generator> multiLineString(int numLines,
int numPoints, Box bbox, Random rnd) {
return new DefaultMultiLineStringGenerator<>(numLines, numPoints, bbox, rnd);
}
public static
Generator> multiLineString(int numLines,
int numPoints, Box bbox) {
return new DefaultMultiLineStringGenerator<>(numLines, numPoints, bbox, new Random());
}
public static
Generator> multiPolygon
(int numLines, int numPoints, Box bbox, Random rnd) {
return new DefaultMultiPolygonGenerator<>(numLines, numPoints, bbox, rnd);
}
public static
Generator> multiPolygon
(int numLines, int numPoints, Box bbox) {
return new DefaultMultiPolygonGenerator<>(numLines, numPoints, bbox, new Random());
}
@SafeVarargs
public static
Generator> geometryCollection
(int numGeoms, Random rnd, Generator extends Geometry>... generators) {
Generator> combine = combine(asList(generators));
return new DefaultGeometryCollectionGenerator<>(numGeoms, combine, rnd);
}
@SafeVarargs
public static Generator> geometryCollection
(int numGeoms, Generator extends Geometry>... generators) {
return geometryCollection(numGeoms, new Random(), generators);
}
}