Class POIGeomReader

  • All Implemented Interfaces:
    GeomReader, java.lang.Comparable

    public class POIGeomReader
    extends AbstractGeomReader
    A GeomReader for reading vehicle geometry from a POINTS (POI) formatted geometry file. This is the geometry file format used by A502 (PANAIR) and A633 (TRANAIR) for input geometry.

    Modified by: Joseph A. Huwaldt

    Version:
    January 1, 2024
    Author:
    Joseph A. Huwaldt, Date: April 14, 2000
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EXTENSION  
    • Constructor Summary

      Constructors 
      Constructor Description
      POIGeomReader()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int canReadData​(java.io.File inputFile)
      Method that determines if this reader can read paneled geometry from the specified input file.
      java.lang.String getExtension()
      Returns the preferred file extension (not including the ".") for files of this GeomReader's type.
      boolean isUnitAware()
      This method always returns false as POI files do not encode the units that are being used.
      PointVehicle read​(java.io.File inputFile)
      Reads in a POINTS (POI) geometry file from the specified input file and returns a PointVehicle object that contains the geometry from the POI file.
      java.lang.String toString()
      Returns a string representation of the object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of the object. This will return a brief description of the format read by this reader.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A brief description of the format read by this reader.
      • getExtension

        public java.lang.String getExtension()
        Returns the preferred file extension (not including the ".") for files of this GeomReader's type.
        Returns:
        The preferred extension for this file type.
      • canReadData

        public int canReadData​(java.io.File inputFile)
                        throws java.io.IOException
        Method that determines if this reader can read paneled geometry from the specified input file.
        Specified by:
        canReadData in interface GeomReader
        Overrides:
        canReadData in class AbstractGeomReader
        Parameters:
        inputFile - The input file containing the geometry to be read in.
        Returns:
        GeomReader.NO if the file format is not recognized by this reader. GeomReader.YES if the file format is definitely recognized by this reader. GeomReader.MAYBE if the file format might be readable by this reader, but that can't easily be determined without actually reading the file.
        Throws:
        java.io.IOException - If there is a problem reading from the specified file.
      • read

        public PointVehicle read​(java.io.File inputFile)
                          throws java.io.IOException
        Reads in a POINTS (POI) geometry file from the specified input file and returns a PointVehicle object that contains the geometry from the POI file.

        Each component will have an Integer stored in the user data under the key "A502A633TypeCode" that contains the A502-A633 array type code for all the networks contained in that component.

        WARNING: This file format is not unit aware. You must set the units to be used by calling "setFileUnits()" before calling this method!

        Specified by:
        read in interface GeomReader
        Overrides:
        read in class AbstractGeomReader
        Parameters:
        inputFile - The input file containing the geometry to be read in. May not be null.
        Returns:
        A PointVehicle object containing the geometry read in from the file. If the file has no geometry in it, then this list will have no components in it (will have a size() of zero).
        Throws:
        java.io.IOException - If there is a problem reading the specified file.
        See Also:
        AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)
      • isUnitAware

        public boolean isUnitAware()
        This method always returns false as POI files do not encode the units that are being used. You must call setFileUnits to set the units being used before reading from a file of this format.
        Returns:
        This implementation always returns false.
        See Also:
        AbstractGeomReader.setFileUnits(javax.measure.unit.Unit)