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

## Class OsmFileReader

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

All Implemented Interfaces:
  `Serializable`, `DataSourceInterface`

    public class OsmFileReader
    extends Object
    implements DataSourceInterface

OsmFileReader reads one layer from an OpenStreetMap file based on the given specifications. The supported formats are pbf, osm, osm.gz, and osm.bz2.

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
See Also:
  Serialized Form

### Constructor Summary

Constructors
`OsmFileReader​(URL osmURL, CoordinateTransform coordinateTransform, List<FeatureInterface> featuresToRead)` Constructs a new reader for a layer in an OSM shape file.

### Method Summary

All Methods Instance Methods Concrete Methods
`List<FeatureInterface>` `getFeatures()`
`URL` `getURL()`
`boolean` `isDynamic()`
`void` `populateShapes()`

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

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

### Constructor Detail

#### OsmFileReader

    public OsmFileReader​(URL osmURL,
                         CoordinateTransform coordinateTransform,
                         List<FeatureInterface> featuresToRead)
                  throws IOException

Constructs a new reader for a layer in an OSM shape file.

Parameters:
  `osmURL` - URL; URL can have several valid extensions: .pbf, .osm, .osm.gz, and .osm.bz2
  `coordinateTransform` - CoordinateTransform; the transformation of (x, y) coordinates to (x', y') coordinates.
  `featuresToRead` - the features to read
Throws:
  `IOException` - throws an IOException if the url is not accessible

### Method Detail

#### getFeatures

    public List<FeatureInterface> getFeatures()

Specified by:
  `getFeatures` in interface `DataSourceInterface`

#### populateShapes

    public void populateShapes()
                        throws IOException

Specified by:
  `populateShapes` in interface `DataSourceInterface`
Throws:
  `IOException`

#### getURL

    public URL getURL()

Specified by:
  `getURL` in interface `DataSourceInterface`

#### isDynamic

    public boolean isDynamic()

Specified by:
  `isDynamic` in interface `DataSourceInterface`