Class BBOXConverter


  • public class BBOXConverter
    extends Object
    The Class BBOXConverter.
    Author:
    Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it Dec 18, 2023
    • Constructor Detail

      • BBOXConverter

        public BBOXConverter()
    • Method Detail

      • convertToPixel

        public static BBOXConverter.BBOXPixel convertToPixel​(Integer[] size,
                                                             Double[] bbox)
        Convert to pixel.
        Parameters:
        size - the size
        bbox - the bbox
        Returns:
        the BBOX converter. BBOX pixel
      • convertToCoordinate

        public static org.gcube.spatial.data.geoutility.shared.BBOX convertToCoordinate​(BBOXConverter.BBOXPixel bboxP,
                                                                                        Integer[] size)
        Convert to coordinate.
        Parameters:
        bboxP - the bbox P
        size - the size
        Returns:
        the bbox
      • bboxWithOffset

        public static String bboxWithOffset​(String wmsVersion,
                                            String bbox,
                                            double bboxOffset)
        Bbox with offset.
        Parameters:
        wmsVersion - the wms version
        bbox - the bbox
        bboxOffset - the bbox offset
        Returns:
        the string
      • toBBOX

        public static org.gcube.spatial.data.geoutility.shared.BBOX toBBOX​(String wmsVersion,
                                                                           String bbox)
        To BBOX.
        Parameters:
        wmsVersion - the wms version
        bbox - the bbox
        Returns:
        the bbox
      • mercatorToPixels

        public static List<Double> mercatorToPixels​(List<Double> bbox)
        Converts spherical web mercator to tile pixel X/Y at zoom level 0 for 256x256 tile size and inverts y coordinates.
        Parameters:
        bbox - the bbox
        Returns:
        {L.point} point with tile pixel x and y coordinates.
      • bboxOffset

        public static Double bboxOffset​(String cMin,
                                        String cMax)
        Bbox offset.
        Parameters:
        cMin - the c min
        cMax - the c max
        Returns:
        the double
      • bestBBOXOffset

        public static Double bestBBOXOffset​(String wmsVersion,
                                            String source_bbox)
        Best BBOX offset.
        Parameters:
        wmsVersion - the wms version
        source_bbox - the source bbox
        Returns:
        the double