private double[] getMinMax() {
        double[] minmax = new double[4];
        double minX;
        double maxX;
        double minY;
        double maxY;
        try {
            String sql = "SELECT  (\n"
                    + "        SELECT MIN([start-x-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c1,\n"
                    + "		(\n"
                    + "        SELECT MIN([end-x-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c2,\n"
                    + "		(\n"
                    + "        SELECT MAX([start-x-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c3,\n"
                    + "        (\n"
                    + "        SELECT MAX([end-x-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c4,\n"
                    + "		(\n"
                    + "        SELECT MIN([start-y-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c5,\n"
                    + "		(\n"
                    + "        SELECT MIN([end-y-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c6,\n"
                    + "		(\n"
                    + "		SELECT MAX([start-y-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c7,\n"
                    + "		(\n"
                    + "        SELECT MAX([end-y-coord])\n"
                    + "        FROM   correctedCoastLine\n"
                    + "        ) AS c8\n"
                    + "		\n"
                    + "";
            Connection con = cpds.getConnection();

            PreparedStatement pstatement = con.prepareStatement(sql);
            ResultSet rs = executeQuery(pstatement);

            while (rs.next()) {
                minX = Math.min(rs.getDouble(1), rs.getDouble(2));
                maxX = Math.max(rs.getDouble(3), rs.getDouble(4));
                minY = Math.min(rs.getDouble(5), rs.getDouble(6));
                maxY = Math.max(rs.getDouble(7), rs.getDouble(8));
                
                //To clarify what is what;
                minmax[0] = minX;
                minmax[1] = maxX;
                minmax[2] = minY;
                minmax[3] = maxY;
            }
            
        } catch (SQLException ex) {
            printSQLException(ex);
        } finally {
            closeConnection(cons, pstatements, resultsets);
        }
        return minmax;

    }