Class LasReaderBuffered
- java.lang.Object
-
- org.hortonmachine.gears.io.las.core.Las
-
- org.hortonmachine.gears.io.las.core.ALasReader
-
- org.hortonmachine.gears.io.las.core.v_1_0.LasReaderBuffered
-
- All Implemented Interfaces:
AutoCloseable
public class LasReaderBuffered extends ALasReader
Las record reader for las spec 1.0.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description LasReaderBuffered(File lasFile, int bufferSizeInPointsNum, org.opengis.referencing.crs.CoordinateReferenceSystem crs)LasReaderBuffered(File lasFile, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the las data source and free resources.ILasHeadergetHeader()Get the las header.FilegetLasFile()Get a reference to the las file.LasRecordgetNextPoint()Read the next record into aLasRecordobject.LasRecordgetPointAt(long pointNumber)Reads a dot at a given point position.LasRecordgetPointAtAddress(long address)Reads a dot at a given address.booleanhasNextPoint()Check if there are still data available.voidopen()Open the las data source.double[]readNextLasXYZAddress()Reads the position and the record address in the file of the next point.voidrewind()Rewind the iterator to start from scratch.voidseek(long pointNumber)Move to a given point in the file.voidsetOverrideGpsTimeType(int type)Overrides the time type.
-
-
-
Method Detail
-
getLasFile
public File getLasFile()
Description copied from class:ALasReaderGet a reference to the las file.- Specified by:
getLasFilein classALasReader- Returns:
- the las file.
-
open
public void open() throws ExceptionDescription copied from class:ALasReaderOpen the las data source.- Specified by:
openin classALasReader- Throws:
Exception
-
close
public void close() throws ExceptionDescription copied from class:ALasReaderClose the las data source and free resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classALasReader- Throws:
Exception
-
setOverrideGpsTimeType
public void setOverrideGpsTimeType(int type)
Description copied from class:ALasReaderOverrides 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.
- Specified by:
setOverrideGpsTimeTypein classALasReader- Parameters:
type- the type to set.
-
hasNextPoint
public boolean hasNextPoint() throws IOExceptionDescription copied from class:ALasReaderCheck if there are still data available.- Specified by:
hasNextPointin classALasReader- Returns:
trueif there are still data to read.- Throws:
IOException
-
getNextPoint
public LasRecord getNextPoint() throws IOException
Description copied from class:ALasReaderRead the next record into aLasRecordobject.- Specified by:
getNextPointin classALasReader- Returns:
- the read object or
nullif none available. - Throws:
IOException
-
getPointAtAddress
public LasRecord getPointAtAddress(long address) throws IOException
Description copied from class:ALasReaderReads a dot at a given address.- Specified by:
getPointAtAddressin classALasReader- Parameters:
address- the file address of the record to read.- Returns:
- the read record.
- Throws:
IOException
-
getPointAt
public LasRecord getPointAt(long pointNumber) throws IOException
Description copied from class:ALasReaderReads a dot at a given point position.- Specified by:
getPointAtin classALasReader- Parameters:
pointNumber- the point position.- Returns:
- the read record.
- Throws:
IOException
-
readNextLasXYZAddress
public double[] readNextLasXYZAddress() throws IOExceptionDescription copied from class:ALasReaderReads the position and the record address in the file of the next point.- Specified by:
readNextLasXYZAddressin classALasReader- Returns:
- the array containing [x, y, z, address].
- Throws:
IOException
-
seek
public void seek(long pointNumber) throws IOExceptionDescription copied from class:ALasReaderMove to a given point in the file.The position starts with 0 at the first point position.
Note that not
ALasReader.hasNextPoint()can be called after seek,ALasReader.getNextPoint()must be called directly instead.- Specified by:
seekin classALasReader- Parameters:
pointNumber- the number of records to skip.- Throws:
IOException
-
getHeader
public ILasHeader getHeader()
Description copied from class:ALasReaderGet the las header.- Specified by:
getHeaderin classALasReader- Returns:
- the las header.
-
rewind
public void rewind() throws IOExceptionDescription copied from class:ALasReaderRewind the iterator to start from scratch.- Specified by:
rewindin classALasReader- Throws:
IOException
-
-