Class ALasReader
- java.lang.Object
-
- org.hortonmachine.gears.io.las.core.Las
-
- org.hortonmachine.gears.io.las.core.ALasReader
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
LasReaderBuffered,LaszipReader
public abstract class ALasReader extends Las implements AutoCloseable
Interface for las readers.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description ALasReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidclose()Close the las data source and free resources.abstract ILasHeadergetHeader()Get the las header.abstract FilegetLasFile()Get a reference to the las file.abstract LasRecordgetNextPoint()Read the next record into aLasRecordobject.abstract LasRecordgetPointAt(long pointPosition)Reads a dot at a given point position.abstract LasRecordgetPointAtAddress(long address)Reads a dot at a given address.abstract booleanhasNextPoint()Check if there are still data available.abstract voidopen()Open the las data source.abstract double[]readNextLasXYZAddress()Reads the position and the record address in the file of the next point.abstract voidrewind()Rewind the iterator to start from scratch.abstract voidseek(long pointNumber)Move to a given point in the file.abstract voidsetOverrideGpsTimeType(int type)Overrides the time type.
-
-
-
Method Detail
-
close
public abstract void close() throws ExceptionClose the las data source and free resources.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getLasFile
public abstract File getLasFile()
Get a reference to the las file.- Returns:
- the las file.
-
getHeader
public abstract ILasHeader getHeader()
Get the las header.- Returns:
- the las header.
-
hasNextPoint
public abstract boolean hasNextPoint() throws IOExceptionCheck if there are still data available.- Returns:
trueif there are still data to read.- Throws:
IOException
-
getNextPoint
public abstract LasRecord getNextPoint() throws IOException
Read the next record into aLasRecordobject.- Returns:
- the read object or
nullif none available. - Throws:
IOException
-
rewind
public abstract void rewind() throws IOExceptionRewind the iterator to start from scratch.- Throws:
IOException
-
getPointAtAddress
public abstract LasRecord getPointAtAddress(long address) throws IOException
Reads a dot at a given address.- Parameters:
address- the file address of the record to read.- Returns:
- the read record.
- Throws:
IOException
-
getPointAt
public abstract LasRecord getPointAt(long pointPosition) throws IOException
Reads a dot at a given point position.- Parameters:
pointPosition- the point position.- Returns:
- the read record.
- Throws:
IOException
-
readNextLasXYZAddress
public abstract double[] readNextLasXYZAddress() throws IOExceptionReads the position and the record address in the file of the next point.- Returns:
- the array containing [x, y, z, address].
- Throws:
IOException
-
seek
public abstract void seek(long pointNumber) throws IOExceptionMove to a given point in the file.The position starts with 0 at the first point position.
Note that not
hasNextPoint()can be called after seek,getNextPoint()must be called directly instead.- Parameters:
pointNumber- the number of records to skip.- Throws:
IOException
-
setOverrideGpsTimeType
public abstract void setOverrideGpsTimeType(int type)
Overrides the time type.The time type is sometimes found set wrong by certain softwares. This gives the possibility to override it and allow for proper time conversion.
- Parameters:
type- the type to set.
-
-