Search in sources :

Example 1 with Polygon

use of org.geotoolkit.gml.xml.Polygon 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

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