MultiCurve Example - Java - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

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


public static MultiCurve buildMultiCurve() throws Exception
{
    MultiCurve multiCurve = new MultiCurve();
    multiCurve.setSrsName("EPSG:4326");
    Curve curve = new Curve();
    //curve.setSrsName("EPSG:4326");
    //set the lineString.
    LineString lineString = new LineString();
    //lineString.setSrsName("EPSG:4326");

    Pos pos = new Pos();
    pos = new Pos();
    pos.setX(-75.66);
    pos.setY(45.33);
    pos.setMValue(new Double(-12.33));
    lineString.getPos().add(pos);
    //add the viaPoint
    Pos pos1 = new Pos();
    pos1.setX(-77.66);
    pos1.setY(46.33);
    pos1.setMValue(new Double(-17.33));
    lineString.getPos().add(pos1);
    //add the end Point.
    Pos pos2 = new Pos();
    pos2.setX(-78.66);
    pos2.setY(49.33);
    pos2.setMValue(new Double(-19.33));
    lineString.getPos().add(pos2);

    curve.getLineString().add(lineString);
    multiCurve.getCurve().add(curve);

    return multiCurve;
}