MultiPoint Example - Java

The following shows a Java example that returns a MultiPoint object.


public static MultiPoint buildMultiPoint() throws Exception
{
    MultiPoint multiPoint = new MultiPoint();
    multiPoint.setSrsName("EPSG:4326");

    Point point = new Point();
    Pos pos = new Pos();
    pos.setX(-75.44);
    pos.setY(45.66);
    pos.setMValue(new Double(54.33));
    point.setPos(pos);
    multiPoint.getPoint().add(point);

    Point point1 = new Point();
    Pos pos1 = new Pos();
    pos1.setX(-75.44);
    pos1.setY(45.66);
    pos1.setMValue(new Double(54.33));
    point1.setPos(pos1);
    multiPoint.getPoint().add(point1);

    return multiPoint;
}