Class OSHDBBoundingBox

    • Field Detail

      • INVALID

        public static final OSHDBBoundingBox INVALID
        Singleton invalid bounding box.
    • Constructor Detail

      • OSHDBBoundingBox

        @Deprecated(forRemoval=true,
                    since="0.7")
        public OSHDBBoundingBox​(double minLon,
                                double minLat,
                                double maxLon,
                                double maxLat)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an OSHDBBoundingBox with wgs84 coordinates.
        Parameters:
        minLon - minimum longitude in wgs84 coordinate system
        minLat - minimum latitude in wgs84 coordinate system
        maxLon - maximum longitude in wgs84 coordinate system
        maxLat - maximum latitude in wgs84 coordinate system
    • Method Detail

      • bboxOSMCoordinates

        public static OSHDBBoundingBox bboxOSMCoordinates​(int minLon,
                                                          int minLat,
                                                          int maxLon,
                                                          int maxLat)
        Creates an OSHDBBoundingBox instance from scaled coordinates.

        This method is mainly for internal usage.
        OSM stores coordinates with a fixed precision of 7 decimal digits and stores them internally as integers. You can use this method to create a bounding box from such (scaled and rounded) coordinates.
        See bboxWgs84Coordinates for a wgs84 alternative.

        Parameters:
        minLon - minimum longitude in osm-coordinate system
        minLat - minimum latitude in osm-coordinate system
        maxLon - maximum longitude in osm-coordinate system
        maxLat - maximum latitude in osm-coordinate system
        Returns:
        new instance of OSHDBBoundingBox
      • bboxWgs84Coordinates

        public static OSHDBBoundingBox bboxWgs84Coordinates​(double minLon,
                                                            double minLat,
                                                            double maxLon,
                                                            double maxLat)
        Creates an OSHDBBoundingBox from wgs84 coordinates.
        Parameters:
        minLon - minimum longitude in wgs84 coordinate system
        minLat - minimum latitude in wgs84 coordinate system
        maxLon - maximum longitude in wgs84 coordinate system
        maxLat - maximum latitude in wgs84 coordinate system
        Returns:
        new instance of OSHDBBoundingBox
      • getMinLongitude

        public int getMinLongitude()
        Description copied from interface: OSHDBBoundable
        Returns the minimum longitude in osm-coordinate-system.
        Specified by:
        getMinLongitude in interface OSHDBBoundable
        Returns:
        minimum longitude
      • getMaxLongitude

        public int getMaxLongitude()
        Description copied from interface: OSHDBBoundable
        Returns the maximum longitude in osm-coordinate-system.
        Specified by:
        getMaxLongitude in interface OSHDBBoundable
        Returns:
        maximum longitude
      • getMinLatitude

        public int getMinLatitude()
        Description copied from interface: OSHDBBoundable
        Returns the minimum latitude in osm-coordinate-system.
        Specified by:
        getMinLatitude in interface OSHDBBoundable
        Returns:
        minimum latitude
      • getMaxLatitude

        public int getMaxLatitude()
        Description copied from interface: OSHDBBoundable
        Returns the maximum latitude in osm-coordinate-system.
        Specified by:
        getMaxLatitude in interface OSHDBBoundable
        Returns:
        maximum latitude
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object