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

## Interface DataSourceInterface

All Superinterfaces:
  `Serializable`

    public interface DataSourceInterface
    extends Serializable

DataSourceInterface is the connector between the reader of a GIS file and the display in the DSOL animation.

Copyright (c) 2020-2020 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

### Method Summary

All Methods Instance Methods Abstract Methods
`String[][]` `getAttributes()` returns the attribute data.
`String[]` `getColumnNames()` returns the columnNames of the attribute data.
`URL` `getDataSource()` returns the URL of the data source.
`int` `getNumShapes()` returns the number of shapes of the particular data source.
`GisObject` `getShape​(int index)` returns a GisObject.
`List<GisObject>` `getShapes()` returns all the shapes of the particular data source.
`List<GisObject>` `getShapes​(String attribute, String columnName)` returns the shapes based on a particular value of the attributes.
`List<GisObject>` `getShapes​(SerializableRectangle2D rectangle)` returns the shapes of the particular data source in a particular extent.
`int` `getType()`

### Method Detail

#### getColumnNames

    String[] getColumnNames()

returns the columnNames of the attribute data.

Returns:
  String[]

#### getAttributes

    String[][] getAttributes()
                      throws IOException

returns the attribute data.

Returns:
  the attributes
Throws:
  `IOException` - on IOException

#### getDataSource

    URL getDataSource()

returns the URL of the data source.

Returns:
  URL the URL of the file

#### getNumShapes

    int getNumShapes()
              throws IOException

returns the number of shapes of the particular data source.

Returns:
  int the number of shapes
Throws:
  `IOException` - possible file IO or database connection failures.

#### getShape

    GisObject getShape​(int index)
                throws IOException,
                       IndexOutOfBoundsException

returns a GisObject.

Parameters:
  `index` - int; the number of the shape to be returned
Returns:
  GisObject returns a `nl.javel.gisbeans.geom.GisObject`
Throws:
  `IndexOutOfBoundsException` - whenever index > numShapes
  `IOException` - on IOFailure

#### getShapes

    List<GisObject> getShapes()
                       throws IOException

returns all the shapes of the particular data source.

Returns:
  List the resulting ArrayList of `nl.javel.gisbeans.geom.GisObject`
Throws:
  `IOException` - on IOFailure

#### getShapes

    List<GisObject> getShapes​(SerializableRectangle2D rectangle)
                       throws IOException

returns the shapes of the particular data source in a particular extent.

Parameters:
  `rectangle` - SerializableRectangle2D; the extent of the box (in geo-coordinates)
Returns:
  List the resulting ArrayList of `nl.javel.gisbeans.geom.GisObject`
Throws:
  `IOException` - on IOFailure

#### getShapes

    List<GisObject> getShapes​(String attribute,
                              String columnName)
                       throws IOException

returns the shapes based on a particular value of the attributes.

Parameters:
  `attribute` - String; the value of the attribute
  `columnName` - String; the columnName
Returns:
  List the resulting ArrayList of `nl.javel.gisbeans.geom.GisObject`
Throws:
  `IOException` - on IOFailure

#### getType

    int getType()
         throws IOException

Returns:
  returns the type of this dataSouce.
Throws:
  `IOException` - on IOFailure