Package nl.tudelft.simulation.dsol.animation.gis.osm

## Class OsmLayerSink

- java.lang.Object
- - nl.tudelft.simulation.dsol.animation.gis.osm.OsmLayerSink

All Implemented Interfaces:
  `AutoCloseable`, `org.openstreetmap.osmosis.core.lifecycle.Closeable`, `org.openstreetmap.osmosis.core.lifecycle.Completable`, `org.openstreetmap.osmosis.core.task.common.Task`, `org.openstreetmap.osmosis.core.task.v0_6.Initializable`, `org.openstreetmap.osmosis.core.task.v0_6.Sink`

    public class OsmLayerSink
    extends Object
    implements org.openstreetmap.osmosis.core.task.v0_6.Sink

OsmLayerSink.java.

Copyright (c) 2021-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.

Author:
  Alexander Verbraeck

### Constructor Summary

Constructors
`OsmLayerSink​(List<FeatureInterface> featuresToRead, CoordinateTransform coordinateTransform)` Construct a sink to read the features form the OSM file.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`void` `complete()`
`void` `initialize​(Map<String,​Object> metaData)`
`void` `process​(org.openstreetmap.osmosis.core.container.v0_6.EntityContainer entityContainer)`

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### OsmLayerSink

    public OsmLayerSink​(List<FeatureInterface> featuresToRead,
                        CoordinateTransform coordinateTransform)

Construct a sink to read the features form the OSM file. For OSM this the Feature list is typically the complete set of features that needs to be read. It is rare that multiple OSM files are available for the data, but this could be the case (e.g., state or country OSM files).
TODO: add an optional initial extent in case the sounrce's extent is much larger than the extent we want to display

Parameters:
  `featuresToRead` - the features that the sink needs to read.
  `coordinateTransform` - CoordinateTransform; the transformation of (x, y) coordinates to (x', y') coordinates.

### Method Detail

#### process

    public void process​(org.openstreetmap.osmosis.core.container.v0_6.EntityContainer entityContainer)

Specified by:
  `process` in interface `org.openstreetmap.osmosis.core.task.v0_6.Sink`

#### initialize

    public void initialize​(Map<String,​Object> metaData)

Specified by:
  `initialize` in interface `org.openstreetmap.osmosis.core.task.v0_6.Initializable`

#### complete

    public void complete()

Specified by:
  `complete` in interface `org.openstreetmap.osmosis.core.lifecycle.Completable`

#### close

    public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `org.openstreetmap.osmosis.core.lifecycle.Closeable`