Search in sources :

Example 1 with CoordinateFilter

use of org.locationtech.jts.geom.CoordinateFilter in project ddf by codice.

the class AbstractFeatureConverterWfs20 method swapCoordinates.

private void swapCoordinates(Geometry geo) {
    LOGGER.debug("Swapping Lat/Lon Coords to Lon/Lat using Geometry");
    geo.apply(new CoordinateFilter() {

        @Override
        public void filter(Coordinate coordinate) {
            double x = coordinate.x;
            double y = coordinate.y;
            coordinate.y = x;
            coordinate.x = y;
        }
    });
    geo.geometryChanged();
}
Also used : Coordinate(org.locationtech.jts.geom.Coordinate) CoordinateFilter(org.locationtech.jts.geom.CoordinateFilter)

Example 2 with CoordinateFilter

use of org.locationtech.jts.geom.CoordinateFilter in project ddf by codice.

the class AbstractFeatureConverterWfs11 method swapCoordinates.

private void swapCoordinates(Geometry geo) {
    LOGGER.trace("Swapping Lat/Lon Coords to Lon/Lat using Geometry: {}", geo);
    geo.apply(new CoordinateFilter() {

        @Override
        public void filter(Coordinate coordinate) {
            double x = coordinate.x;
            double y = coordinate.y;
            coordinate.y = x;
            coordinate.x = y;
        }
    });
    geo.geometryChanged();
}
Also used : Coordinate(org.locationtech.jts.geom.Coordinate) CoordinateFilter(org.locationtech.jts.geom.CoordinateFilter)

Aggregations

Coordinate (org.locationtech.jts.geom.Coordinate)2 CoordinateFilter (org.locationtech.jts.geom.CoordinateFilter)2