public SRS getSRS() { return gridSet.getSrs(); }
private static CoordinateReferenceSystem getGridsetCrs(GridSubset gridSubset) { final CoordinateReferenceSystem gridSetCrs; SRS srs = gridSubset.getGridSet().getSrs(); try { int epsgCode = srs.getNumber(); String epsgId = "EPSG:" + epsgCode; boolean longitudeFirst = true; // as used by geoserver gridSetCrs = CRS.decode(epsgId, longitudeFirst); } catch (Exception e) { throw new RuntimeException("Can't decode SRS ESPG:" + srs.getNumber()); } return gridSetCrs; }
static class CustomLayerImplementation { private String name; private String title; private boolean isAuthorized; private List<String> formats; public CustomLayerImplementation( String name, String title, boolean isAuthorized, List<String> formats) { this.name = name; this.title = title; this.isAuthorized = isAuthorized; this.formats = formats; } }
if (null == extent) { try { SRS srs = gridSet.getSrs(); try { extent = getBounds(srs);
if (dynamic) { try { SRS srs = gridSet.getSrs(); try { extent = getBounds(srs);
final GridSet gridSet = layerGrid.getGridSet(); final String gridSetId = gridSet.getName(); final SRS srs = gridSet.getSrs(); final CoordinateReferenceSystem gridSetCrs; try {
final GridSet gridSet = layerGrid.getGridSet(); final String gridSetId = gridSet.getName(); final SRS srs = gridSet.getSrs(); final CoordinateReferenceSystem gridSetCrs; try {
GridSubset gridSubSet = xmlGridSubset.getGridSubSet(broker); subsets.put(gsetName, gridSubSet); bySrs.put(gridSet.getSrs(), gridSubSet);
@Override public boolean equals(Object obj) { if (!(obj instanceof GridSet)) return false; GridSet other = (GridSet) obj; if (this == other) return true; boolean equals = ObjectUtils.equals(getSrs(), other.getSrs()) && ObjectUtils.equals(getName(), other.getName()) && ObjectUtils.equals(getDescription(), other.getDescription()) && ObjectUtils.equals(getTileWidth(), other.getTileWidth()) && ObjectUtils.equals(getTileHeight(), other.getTileHeight()) && ObjectUtils.equals(isTopLeftAligned(), other.isTopLeftAligned()) && ObjectUtils.equals(isyCoordinateFirst(), other.isyCoordinateFirst()) && ObjectUtils.equals(getOriginalExtent(), other.getOriginalExtent()) && Arrays.equals(getGridLevels(), other.getGridLevels()); return equals; }
private void tileMatrixSet(XMLBuilder xml, GridSet gridSet) throws IOException { xml.indentElement("TileMatrixSet"); xml.simpleElement("ows:Identifier", gridSet.getName(), true); // If the following is not good enough, please get in touch and we will try to fix it :) xml.simpleElement( "ows:SupportedCRS", "urn:ogc:def:crs:EPSG::" + gridSet.getSrs().getNumber(), true); // TODO detect these str.append(" // <WellKnownScaleSet>urn:ogc:def:wkss:GlobalCRS84Pixel</WellKnownScaleSet>\n"); Grid[] grids = gridSet.getGridLevels(); for (int i = 0; i < grids.length; i++) { double[] tlCoordinates = gridSet.getOrderedTopLeftCorner(i); tileMatrix( xml, grids[i], tlCoordinates, gridSet.getTileWidth(), gridSet.getTileHeight(), gridSet.isScaleWarning()); } xml.endElement("TileMatrixSet"); }
/** Builds an XMLGridSet from a GridSet */ public XMLGridSet(GridSet gset) { setAlignTopLeft(gset.isTopLeftAligned()); setYCoordinateFirst(gset.isyCoordinateFirst()); setExtent(gset.getOriginalExtent()); setLevels(null); if (gset.isResolutionsPreserved()) { setResolutions(resolutions(gset.getGridLevels())); setScaleDenominators(null); } else { setResolutions(null); setScaleDenominators(scaleDenominators(gset.getGridLevels())); } setMetersPerUnit(gset.getMetersPerUnit()); setName(gset.getName()); setDescription(gset.getDescription()); setPixelSize(gset.getPixelSize()); setScaleNames(scaleNames(gset.getGridLevels())); setSrs(gset.getSrs()); setTileWidth(gset.getTileWidth()); setTileHeight(gset.getTileHeight()); }