GPXBounds.java

  1. /*
  2.  * This file is part of Openrouteservice.
  3.  *
  4.  * Openrouteservice is free software; you can redistribute it and/or modify it under the terms of the
  5.  * GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1
  6.  * of the License, or (at your option) any later version.
  7.  *
  8.  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  9.  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10.  * See the GNU Lesser General Public License for more details.
  11.  *
  12.  * You should have received a copy of the GNU Lesser General Public License along with this library;
  13.  * if not, see <https://www.gnu.org/licenses/>.
  14.  */

  15. package org.heigit.ors.api.responses.routing.gpx;

  16. import com.graphhopper.util.shapes.BBox;
  17. import jakarta.xml.bind.annotation.XmlAttribute;
  18. import org.heigit.ors.api.responses.common.boundingbox.BoundingBox;
  19. import org.heigit.ors.api.responses.common.boundingbox.BoundingBoxBase;
  20. import org.heigit.ors.util.FormatUtility;

  21. public class GPXBounds extends BoundingBoxBase implements BoundingBox {
  22.     public GPXBounds() {
  23.         super();
  24.     }

  25.     public GPXBounds(BBox bounding) {
  26.         super(bounding);
  27.     }

  28.     @Override
  29.     @XmlAttribute(name = "minLat")
  30.     public double getMinLat() {
  31.         return FormatUtility.roundToDecimals(this.minLat, COORDINATE_DECIMAL_PLACES);
  32.     }

  33.     @Override
  34.     @XmlAttribute(name = "minLon")
  35.     public double getMinLon() {
  36.         return FormatUtility.roundToDecimals(this.minLon, COORDINATE_DECIMAL_PLACES);
  37.     }

  38.     @Override
  39.     @XmlAttribute(name = "maxLat")
  40.     public double getMaxLat() {
  41.         return FormatUtility.roundToDecimals(this.maxLat, COORDINATE_DECIMAL_PLACES);
  42.     }

  43.     @Override
  44.     @XmlAttribute(name = "maxLon")
  45.     public double getMaxLon() {
  46.         return FormatUtility.roundToDecimals(this.maxLon, COORDINATE_DECIMAL_PLACES);
  47.     }
  48. }