Class DataSource

java.lang.Object
org.openstreetmap.josm.data.DataSource

public class DataSource extends Object
A data source, defined by bounds and textual description for the origin.
Since:
247 (creation), 7575 (moved package)
  • Field Details

    • bounds

      public final Bounds bounds
      The bounds of this data source
    • origin

      public final String origin
      The textual description of the origin (example: "OpenStreetMap Server")
  • Constructor Details

    • DataSource

      public DataSource(Bounds bounds, String origin)
      Constructs a new DataSource.
      Parameters:
      bounds - The bounds of this data source
      origin - The textual description of the origin (example: "OpenStreetMap Server")
      Throws:
      IllegalArgumentException - if bounds is null
    • DataSource

      public DataSource(DataSource source)
      Constructs a new DataSource
      Parameters:
      source - The source to copy the data from.
      Since:
      10346
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDataSourceArea

      public static Area getDataSourceArea(Collection<DataSource> dataSources)
      Returns the total area of downloaded data (the "yellow rectangles").
      Parameters:
      dataSources - list of data sources
      Returns:
      Area object encompassing downloaded data.
      See Also:
    • getDataSourceBounds

      public static List<Bounds> getDataSourceBounds(Collection<DataSource> dataSources)

      Replies the list of data source bounds.

      Dataset maintains a list of data sources which have been merged into the data set. Each of these sources can optionally declare a bounding box of the data it supplied to the dataset.

      This method replies the list of defined (non null) bounding boxes.

      Parameters:
      dataSources - list of data sources
      Returns:
      the list of data source bounds. An empty list, if no non-null data source bounds are defined.
      See Also: