Class AtlasDataSource
- java.lang.Object
-
- org.openstreetmap.atlas.checks.distributed.AtlasDataSource
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.AutoCloseable
public class AtlasDataSource extends java.lang.Object implements java.io.Serializable, java.lang.AutoCloseableResolvesAtlasdata source(s) from aninputlocation. Multiple data files found are stitched together to build a singleAtlasdata source. Supported data source types areAtlasand 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 basicAtlasDataSourceAtlasDataSource(java.util.Map<java.lang.String,java.lang.String> sparkContext, org.openstreetmap.atlas.utilities.configuration.Configuration configuration, org.openstreetmap.atlas.geography.MultiPolygon polygon)Constructs anAtlasDataSourcewith aMultiPolygonboundary.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 anAtlasDataSourcewith bounding box.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.openstreetmap.atlas.geography.atlas.AtlasgetAtlas()org.openstreetmap.atlas.geography.atlas.Atlasload(java.lang.String input, java.lang.String country)Loads anAtlasfrom the input locationorg.openstreetmap.atlas.geography.atlas.Atlasload(java.lang.String input, java.lang.String country, java.util.function.Consumer<org.openstreetmap.atlas.geography.atlas.Atlas> intermediateAtlasHandler)Loads anAtlasfrom the input location.voidsetAtlas(org.openstreetmap.atlas.geography.atlas.Atlas atlas)
-
-
-
Constructor Detail
-
AtlasDataSource
public AtlasDataSource(java.util.Map<java.lang.String,java.lang.String> sparkContext, org.openstreetmap.atlas.utilities.configuration.Configuration configuration)Constructs a basicAtlasDataSource- Parameters:
sparkContext- Spark context as key-value pairs to use as contextconfiguration- TheConfiguration
-
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 anAtlasDataSourcewith aMultiPolygonboundary. OnlyAtlasdata within the boundary will be loaded- Parameters:
sparkContext- spark context as key-value pairs to use as contextconfiguration- theConfigurationpolygon- aMultiPolygonboundary
-
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 anAtlasDataSourcewith bounding box. OnlyAtlasdata within the bounding box will be loaded- Parameters:
sparkContext- spark context as key-value pairs to use as contextconfiguration- theConfigurationboundingBox- aRectangleboundary
-
-
Method Detail
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.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 anAtlasfrom the input location- Parameters:
input- location of theAtlassourcecountry- country of theAtlas- Returns:
Atlasrepresentation 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 anAtlasfrom the input location. IntermediateAtlases created are submitted to the providedConsumerto allow for any additional handling.- Parameters:
input- location of theAtlassourcecountry- country of theAtlasintermediateAtlasHandler- handler given intermediateAtlasfiles when created- Returns:
Atlasrepresentation of the data source
-
setAtlas
public void setAtlas(org.openstreetmap.atlas.geography.atlas.Atlas atlas)
-
-