Class AtlasDataSource

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.AutoCloseable

    public class AtlasDataSource
    extends java.lang.Object
    implements java.io.Serializable, java.lang.AutoCloseable
    Resolves Atlas data source(s) from an input location. Multiple data files found are stitched together to build a single Atlas data source. Supported data source types are Atlas and Osm Protobuf files.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext, org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
      Constructs a basic AtlasDataSource
      AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext, org.openstreetmap.atlas.utilities.configuration.Configuration configuration, org.openstreetmap.atlas.geography.MultiPolygon polygon)
      Constructs an AtlasDataSource with a MultiPolygon boundary.
      AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext, org.openstreetmap.atlas.utilities.configuration.Configuration configuration, org.openstreetmap.atlas.geography.Rectangle boundingBox)
      Constructs an AtlasDataSource with bounding box.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      org.openstreetmap.atlas.geography.atlas.Atlas getAtlas()  
      org.openstreetmap.atlas.geography.atlas.Atlas load​(java.lang.String input, java.lang.String country)
      Loads an Atlas from the input location
      org.openstreetmap.atlas.geography.atlas.Atlas load​(java.lang.String input, java.lang.String country, java.util.function.Consumer<org.openstreetmap.atlas.geography.atlas.Atlas> intermediateAtlasHandler)
      Loads an Atlas from the input location.
      void setAtlas​(org.openstreetmap.atlas.geography.atlas.Atlas atlas)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AtlasDataSource

        public AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext,
                               org.openstreetmap.atlas.utilities.configuration.Configuration configuration)
        Constructs a basic AtlasDataSource
        Parameters:
        sparkContext - Spark context as key-value pairs to use as context
        configuration - The Configuration
      • AtlasDataSource

        public AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext,
                               org.openstreetmap.atlas.utilities.configuration.Configuration configuration,
                               org.openstreetmap.atlas.geography.MultiPolygon polygon)
        Constructs an AtlasDataSource with a MultiPolygon boundary. Only Atlas data within the boundary will be loaded
        Parameters:
        sparkContext - spark context as key-value pairs to use as context
        configuration - the Configuration
        polygon - a MultiPolygon boundary
      • AtlasDataSource

        public AtlasDataSource​(java.util.Map<java.lang.String,​java.lang.String> sparkContext,
                               org.openstreetmap.atlas.utilities.configuration.Configuration configuration,
                               org.openstreetmap.atlas.geography.Rectangle boundingBox)
        Constructs an AtlasDataSource with bounding box. Only Atlas data within the bounding box will be loaded
        Parameters:
        sparkContext - spark context as key-value pairs to use as context
        configuration - the Configuration
        boundingBox - a Rectangle boundary
    • Method Detail

      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • getAtlas

        public org.openstreetmap.atlas.geography.atlas.Atlas getAtlas()
      • load

        public org.openstreetmap.atlas.geography.atlas.Atlas load​(java.lang.String input,
                                                                  java.lang.String country)
        Loads an Atlas from the input location
        Parameters:
        input - location of the Atlas source
        country - country of the Atlas
        Returns:
        Atlas representation of the data source
      • load

        public org.openstreetmap.atlas.geography.atlas.Atlas load​(java.lang.String input,
                                                                  java.lang.String country,
                                                                  java.util.function.Consumer<org.openstreetmap.atlas.geography.atlas.Atlas> intermediateAtlasHandler)
        Loads an Atlas from the input location. Intermediate Atlases created are submitted to the provided Consumer to allow for any additional handling.
        Parameters:
        input - location of the Atlas source
        country - country of the Atlas
        intermediateAtlasHandler - handler given intermediate Atlas files when created
        Returns:
        Atlas representation of the data source
      • setAtlas

        public void setAtlas​(org.openstreetmap.atlas.geography.atlas.Atlas atlas)