Beispiel #1
0
 @Override
 public String mimeType(Version version) {
   if (version != null && VERSION_11.equals(version)) {
     return MIMETYPE_11;
   }
   return MIMETYPE_10;
 }
Beispiel #2
0
  /**
   * Returns a supported version according to the version negotiation rules in section 6.2.4 of the
   * WMS 1.3.0 spec.
   *
   * <p>For instance: <u>
   * <li>request version not provided? -> higher version supported
   * <li>requested version supported? -> that same version
   * <li>requested version < lowest supported version? -> lowest supported
   * <li>requested version > lowest supported version? -> higher supported version that's lower than
   *     the requested version </u>
   *
   * @param requestedVersion the request version, or {@code null} if unspecified
   * @return
   */
  public static Version negotiateVersion(final Version requestedVersion) {
    if (null == requestedVersion) {
      return VERSION_1_3_0;
    }
    if (VERSION_1_1_1.equals(requestedVersion)) {
      return VERSION_1_1_1;
    }
    if (VERSION_1_3_0.equals(requestedVersion)) {
      return VERSION_1_3_0;
    }
    if (requestedVersion.compareTo(VERSION_1_3_0) < 0) {
      return VERSION_1_1_1;
    }

    return VERSION_1_3_0;
  }
Beispiel #3
0
  /**
   * Transforms a crs identifier to its internal representation based on the specified WMS version.
   *
   * <p>In version 1.3 of WMS geographic coordinate systems are to be ordered y/x or
   * latitude/longitude. The only possible way to represent this internally is to use the explicit
   * epsg namespace "urn:x-ogc:def:crs:EPSG:". This method essentially replaces the traditional
   * "EPSG:" namespace with the explicit.
   */
  public static String toInternalSRS(String srs, Version version) {
    if (VERSION_1_3_0.equals(version)) {
      if (srs != null && srs.toUpperCase().startsWith("EPSG:")) {
        srs = srs.toUpperCase().replace("EPSG:", "urn:x-ogc:def:crs:EPSG:");
      }
    }

    return srs;
  }