Class AbstractWMSTileSource

java.lang.Object
org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource
org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
org.openstreetmap.josm.data.imagery.AbstractWMSTileSource
All Implemented Interfaces:
org.openstreetmap.gui.jmapviewer.interfaces.Attributed, org.openstreetmap.gui.jmapviewer.interfaces.TileSource
Direct Known Subclasses:
TemplatedWMSTileSource, WMSEndpointTileSource

public abstract class AbstractWMSTileSource extends org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
Base class for different WMS tile sources those based on URL templates and those based on WMS endpoints
Since:
10990
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private EastNorth
     
    private double[]
     
    (package private) static final NumberFormat
     
    private static final double
     
    private Projection
     
    private int[]
     
    private int[]
     
    private int[]
     
    private int[]
     

    Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource

    maxZoom, minZoom, osmMercator

    Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource

    baseUrl, id, modTileFeatures, name, tileSize

    Fields inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource

    attributionImage, attributionImageURL, attributionLinkURL, attributionText, termsOfUseText, termsOfUseURL
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractWMSTileSource(org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo info, Projection tileProjection)
    Constructs a new AbstractWMSTileSource.
  • Method Summary

    Modifier and Type
    Method
    Description
    private org.openstreetmap.gui.jmapviewer.TileXY
    eastNorthToTileXY(EastNorth enPoint, int zoom)
     
    protected String
    getBbox(int zoom, int tilex, int tiley, boolean switchLatLon)
     
    private static String
    getBboxstr(double x1, double x2, double x3, double x4)
     
    private double
     
     
    protected EastNorth
    getTileEastNorth(int x, int y, int z)
     
     
    int
    getTileXMax(int zoom)
     
    int
    getTileXMin(int zoom)
     
    int
    getTileYMax(int zoom)
     
    int
    getTileYMin(int zoom)
     
    private void
     
    void
    Initializes class with current projection in JOSM.
    void
    Initializes class with projection in JOSM.
    org.openstreetmap.gui.jmapviewer.TileXY
    latLonToTileXY(double lat, double lon, int zoom)
     
    latLonToXY(double lat, double lon, int zoom)
     
    org.openstreetmap.gui.jmapviewer.TileXY
    projectedToTileXY(org.openstreetmap.gui.jmapviewer.interfaces.IProjected p, int zoom)
     
    void
    setTileProjection(Projection tileProjection)
     
    org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate
    tileXYToLatLon(int x, int y, int zoom)
     
    org.openstreetmap.gui.jmapviewer.interfaces.IProjected
    tileXYtoProjected(int x, int y, int zoom)
     
    org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate
    xyToLatLon(int x, int y, int zoom)
     

    Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource

    getCoveringTileRange, getDistance, getMaxZoom, getMinZoom, isInside

    Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource

    getBaseUrl, getDefaultTileSize, getExtension, getId, getMetadata, getName, getTileId, getTilePath, getTileSize, getTileUrl, isModTileFeatures, isNoTileAtZoom, toString

    Methods inherited from class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource

    getAttributionImage, getAttributionImageURL, getAttributionLinkURL, getAttributionText, getTermsOfUseText, getTermsOfUseURL, requiresAttribution, setAttributionImage, setAttributionImageURL, setAttributionLinkURL, setAttributionText, setTermsOfUseText, setTermsOfUseURL

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource

    latLonToTileXY, latLonToXY, tileXYToLatLon, tileXYToLatLon, xyToLatLon
  • Field Details

  • Constructor Details

    • AbstractWMSTileSource

      protected AbstractWMSTileSource(org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo info, Projection tileProjection)
      Constructs a new AbstractWMSTileSource.
      Parameters:
      info - tile source info
      tileProjection - the tile projection
  • Method Details

    • initAnchorPosition

      private void initAnchorPosition(Projection proj)
    • setTileProjection

      public void setTileProjection(Projection tileProjection)
    • getTileProjection

    • initProjection

      public void initProjection()
      Initializes class with current projection in JOSM. This call is needed every time projection changes.
    • initProjection

      public void initProjection(Projection proj)
      Initializes class with projection in JOSM. This call is needed every time projection changes.
      Parameters:
      proj - new projection that shall be used for computations
    • tileXYToLatLon

      public org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate tileXYToLatLon(int x, int y, int zoom)
      Specified by:
      tileXYToLatLon in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      tileXYToLatLon in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • eastNorthToTileXY

      private org.openstreetmap.gui.jmapviewer.TileXY eastNorthToTileXY(EastNorth enPoint, int zoom)
    • latLonToTileXY

      public org.openstreetmap.gui.jmapviewer.TileXY latLonToTileXY(double lat, double lon, int zoom)
      Specified by:
      latLonToTileXY in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      latLonToTileXY in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • getTileXMax

      public int getTileXMax(int zoom)
      Specified by:
      getTileXMax in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      getTileXMax in class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
    • getTileXMin

      public int getTileXMin(int zoom)
      Specified by:
      getTileXMin in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      getTileXMin in class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
    • getTileYMax

      public int getTileYMax(int zoom)
      Specified by:
      getTileYMax in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      getTileYMax in class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
    • getTileYMin

      public int getTileYMin(int zoom)
      Specified by:
      getTileYMin in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      getTileYMin in class org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource
    • latLonToXY

      public Point latLonToXY(double lat, double lon, int zoom)
      Specified by:
      latLonToXY in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      latLonToXY in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • xyToLatLon

      public org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate xyToLatLon(int x, int y, int zoom)
      Specified by:
      xyToLatLon in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      xyToLatLon in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • getTileEastNorth

      protected EastNorth getTileEastNorth(int x, int y, int z)
    • getDegreesPerTile

      private double getDegreesPerTile(int zoom)
    • tileXYtoProjected

      public org.openstreetmap.gui.jmapviewer.interfaces.IProjected tileXYtoProjected(int x, int y, int zoom)
      Specified by:
      tileXYtoProjected in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      tileXYtoProjected in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • projectedToTileXY

      public org.openstreetmap.gui.jmapviewer.TileXY projectedToTileXY(org.openstreetmap.gui.jmapviewer.interfaces.IProjected p, int zoom)
      Specified by:
      projectedToTileXY in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      projectedToTileXY in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • getServerCRS

      public String getServerCRS()
      Specified by:
      getServerCRS in interface org.openstreetmap.gui.jmapviewer.interfaces.TileSource
      Overrides:
      getServerCRS in class org.openstreetmap.gui.jmapviewer.tilesources.TMSTileSource
    • getBbox

      protected String getBbox(int zoom, int tilex, int tiley, boolean switchLatLon)
    • getBboxstr

      private static String getBboxstr(double x1, double x2, double x3, double x4)