org.geoserver.wms.WMS.toInternalSRS()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.geoserver.wms.WMS.toInternalSRS()方法的一些代码示例,展示了WMS.toInternalSRS()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WMS.toInternalSRS()方法的具体详情如下:
包路径:org.geoserver.wms.WMS
类名称:WMS
方法名:toInternalSRS

WMS.toInternalSRS介绍

[英]Transforms a crs identifier to its internal representation based on the specified WMS version.

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.
[中]基于指定的WMS版本将crs标识符转换为其内部表示形式。
在WMS版本1.3中,地理坐标系的顺序为y/x或纬度/经度。在内部表示这一点的唯一可能方法是使用显式的epsg名称空间“urn:x-ogc:def:crs:epsg:”。这种方法实质上用显式的名称空间替换了传统的“EPSG:”名称空间。

代码示例

代码示例来源:origin: org.geoserver/gs-wms

private boolean isWms13FlippedCRS(CoordinateReferenceSystem crs) {
  try {
    String code = CRS.lookupIdentifier(crs, false);
    if (!code.contains("EPSG:")) {
      code = "EPGS:" + code;
    }
    code = WMS.toInternalSRS(code, WMS.version("1.3.0"));
    CoordinateReferenceSystem crs13 = CRS.decode(code);
    return CRS.getAxisOrder(crs13) == AxisOrder.NORTH_EAST;
  } catch (Exception e) {
    LOGGER.log(Level.WARNING, "Failed to determine CRS axis order, assuming is EN", e);
    return false;
  }
}

代码示例来源:origin: org.geoserver/gs-wms

crs = CRS.decode(WMS.toInternalSRS(srs, WMS.VERSION_1_3_0));
} catch (Exception e) {
  LOGGER.log(Level.WARNING, "Unable to decode " + srs, e);

代码示例来源:origin: org.geoserver/gs-wms

epsgCode = WMS.toInternalSRS(epsgCode, WMS.version(getMap.getVersion()));
getMap.setSRS(epsgCode);

代码示例来源:origin: org.geoserver.web/gs-web-demo

crs = CRS.decode(code);
wkt = crs.toString();
String epsgOrderCode = WMS.toInternalSRS(code, new Version("1.3.0"));
CoordinateReferenceSystem epsgCrs = CRS.decode(epsgOrderCode);
String epsgOrderCode = WMS.toInternalSRS(code, new Version("1.3.0"));
CoordinateReferenceSystem epsgCrs = CRS.decode(epsgOrderCode);
epsgWkt = epsgCrs.toString();

相关文章