/** * Creates a {@link MultiPoint} using the given {@link Point}s. * A null or empty array will create an empty MultiPoint. * * @param point an array of Points (without null elements), or an empty array, or <code>null</code> * @return a MultiPoint object */ public MultiPoint createMultiPoint(Point[] point) { return new MultiPoint(point, this); }
/** * Creates a {@link MultiPoint} using the given {@link Point}s. * A null or empty array will create an empty MultiPoint. * * @param point an array of Points (without null elements), or an empty array, or <code>null</code> * @return a MultiPoint object */ public MultiPoint createMultiPoint(Point[] point) { return new MultiPoint(point, this); }
Double coordPt[] = new Double[ coordList.size() ]; MultiPoint myMultiPoint = new MultiPoint(coordPt);
@ProcessMethod @OutputParameter(id = "setRandomHeightForMultiPoint", title = "Set a random height for given MultiPoint", description = "Sets a random height for all points inside this MultiPoint", dataType = @DataType(schemaDesignator = "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd#MultiPoint")) public MultiPoint setRandomHeightForMultiPoint( @InputParameter(id = "multipoint", title = "2D Points", description = "A selection of points where you want to define the height") MultiPoint multipoint) { List<Point> transformedPoints = new ArrayList<Point>(); for (Coordinate coordinate : multipoint.getCoordinates()) { coordinate = new Coordinate(coordinate.x, coordinate.y, Math.random()); transformedPoints.add(multipoint.getFactory().createPoint(coordinate)); } MultiPoint transformedMultiPoint = new MultiPoint( transformedPoints.toArray(new Point[transformedPoints.size()]), multipoint.getFactory()); return transformedMultiPoint; } }
@ProcessMethod @OutputParameter(id = "setHeightForMultiPoint", title = "Set height for MultiPoint", description = "Sets the given height for all points inside this MultiPoint", dataType = @DataType(schemaDesignator = "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd#MultiPoint")) public MultiPoint setHeightForMultiPoint( @InputParameter(id = "multipoint", title = "2D Points", description = "A selection of points where you want to define the height") MultiPoint multipoint, @InputParameter(id = "height", title = "Height", description = "The height value") Double height) throws InvalidParameterValueException { if (height < 0) { throw new InvalidParameterValueException( "Given height parameter value needs to be >= 0", String.valueOf(height)); } List<Point> transformedPoints = new ArrayList<Point>(); for (Coordinate coordinate : multipoint.getCoordinates()) { coordinate = new Coordinate(coordinate.x, coordinate.y, height); transformedPoints.add(multipoint.getFactory().createPoint(coordinate)); } MultiPoint transformedMultiPoint = new MultiPoint( transformedPoints.toArray(new Point[transformedPoints.size()]), multipoint.getFactory()); return transformedMultiPoint; } }
Color.RED, 10, SimpleMarkerSymbol.STYLE.CIRCLE); final MultiPoint multiPoint = new MultiPoint(); multiPoint.add(-5.2769,6.8169); multiPoint.add(-3.0195,8.7057);