Search in sources :

Example 1 with LineString

use of org.geotoolkit.gml.xml.LineString in project geotoolkit by Geomatys.

the class OMUtils method buildSamplingCurve.

public static SamplingFeature buildSamplingCurve(final String identifier, final List<DirectPosition> positions) {
    final LineString geom = SOSXmlFactory.buildLineString("2.0.0", null, "EPSG:4326", positions);
    final SamplingFeature sp = SOSXmlFactory.buildSamplingCurve("2.0.0", identifier, null, null, null, geom, null, null, null);
    return sp;
}
Also used : LineString(org.geotoolkit.gml.xml.LineString) SamplingFeature(org.geotoolkit.sampling.xml.SamplingFeature)

Example 2 with LineString

use of org.geotoolkit.gml.xml.LineString in project geotoolkit by Geomatys.

the class GeoSpatialBound method extractBoundary.

private void extractBoundary(final AbstractGeometry geom) {
    if (geom instanceof Point) {
        final Point p = (Point) geom;
        if (p.getPos() != null) {
            addXCoordinate(p.getPos().getOrdinate(0));
            addYCoordinate(p.getPos().getOrdinate(1));
        }
    } else if (geom instanceof LineString) {
        final LineString ls = (LineString) geom;
        final Envelope env = ls.getBounds();
        if (env != null) {
            addXCoordinate(env.getMinimum(0));
            addXCoordinate(env.getMaximum(0));
            addYCoordinate(env.getMinimum(1));
            addYCoordinate(env.getMaximum(1));
        }
    } else if (geom instanceof Polygon) {
        final Polygon p = (Polygon) geom;
        AbstractRing ext = p.getExterior().getAbstractRing();
    // TODO
    }
}
Also used : AbstractRing(org.geotoolkit.gml.xml.AbstractRing) LineString(org.geotoolkit.gml.xml.LineString) Point(org.geotoolkit.gml.xml.Point) Envelope(org.geotoolkit.gml.xml.Envelope) Polygon(org.geotoolkit.gml.xml.Polygon)

Aggregations

LineString (org.geotoolkit.gml.xml.LineString)2 AbstractRing (org.geotoolkit.gml.xml.AbstractRing)1 Envelope (org.geotoolkit.gml.xml.Envelope)1 Point (org.geotoolkit.gml.xml.Point)1 Polygon (org.geotoolkit.gml.xml.Polygon)1 SamplingFeature (org.geotoolkit.sampling.xml.SamplingFeature)1