public class LasFileReader extends Object
This code is based on information that is given in LAS Specification Version 1.4-R13, 15 July 2013.
Modifier and Type | Class and Description |
---|---|
static class |
LasFileReader.CoordinateReferenceSystemOption
Provides definitions for the alternate methods for specifying
a coordinate reference system.
|
Constructor and Description |
---|
LasFileReader(File path) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all internal data files.
|
LasFileReader.CoordinateReferenceSystemOption |
getCoordinateReferenceSystemOption()
Gets the option that was used for storing the coordinate reference
system in the LAS file.
|
File |
getFile()
Get the source file for the reader.
|
String |
getFileSignature() |
GeoTiffData |
getGeoTiffData()
Gets a copy of the GeoTiffData associated with the LAS file, if any.
|
LasGpsTimeType |
getLasGpsTimeType()
Gets the representation of time that is assigned to
the sample point GPS time values.
|
LinearUnits |
getLinearUnits()
Get the linear units specified by the LAS file.
|
double |
getMaxX()
Gets the maximum value for the x coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
double |
getMaxY()
Gets the maximum value for the y coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
double |
getMaxZ()
Gets the maximum value for the z coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
double |
getMinX()
Gets the minimum value for the x coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
double |
getMinY()
Gets the minimum value for the y coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
double |
getMinZ()
Gets the minimum value for the z coordinates of the points in the LAS
file as specified in the LAS-standard file header.
|
long |
getNumberOfPointRecords()
Get the number of point records in file.
|
int |
getPointDataRecordFormat()
Get the record format specified in the LAS file.
|
LasScaleAndOffset |
getScaleAndOffset()
Gets the horizontal and vertical scale and offset factors
that were read from the LAS file header.
|
LasVariableLengthRecord |
getVariableLengthRecordByRecordId(int recordId)
Gets the variable-length record with the specified recordId
|
List<LasVariableLengthRecord> |
getVariableLengthRecordList()
Gets a new instance of a list containing all variable length records.
|
void |
readRecord(long recordIndex,
LasPoint p)
Read a record from the LAS file.
|
byte[] |
readVariableLengthRecordBytes(LasVariableLengthRecord vlr)
Read the content of a variable length record as a series of bytes.
|
double[] |
readVariableLengthRecordDoubles(LasVariableLengthRecord vlr)
Read the content of the Variable Length Record interpreting it as
an array of double-precision floating-point values.
|
int[] |
readVariableLengthRecordUnsignedShorts(LasVariableLengthRecord vlr)
Read the content of the Variable Length Record interpreting it as
an array of unsigned short integers.
|
String |
toString() |
boolean |
usesGeographicCoordinates()
Provides an incomplete and weak implementation of a method that determines
if the LAS file contains a geographic coordinate system.
|
public LasFileReader(File path) throws IOException
IOException
public File getFile()
public void readRecord(long recordIndex, LasPoint p) throws IOException
Note that depending on the record type used in the LAS file, not all elements may be populated.
recordIndex
- the index of the record (0 to numberOfPointRecords-1)p
- a valid instance to receive dataIOException
- In the event of an unrecoverable IOExceptionpublic int getPointDataRecordFormat()
public long getNumberOfPointRecords()
public void close() throws IOException
IOException
- in the event of an non-recoverable IO condition.public String getFileSignature()
public double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
public double getMinZ()
public double getMaxZ()
public LasFileReader.CoordinateReferenceSystemOption getCoordinateReferenceSystemOption()
public List<LasVariableLengthRecord> getVariableLengthRecordList()
public LasVariableLengthRecord getVariableLengthRecordByRecordId(int recordId)
recordId
- a valid record ID in agreement with the LAS specificationpublic byte[] readVariableLengthRecordBytes(LasVariableLengthRecord vlr) throws IOException
vlr
- a valid variable length record from the current fileIOException
- in the event of an unsuccessful read operationpublic int[] readVariableLengthRecordUnsignedShorts(LasVariableLengthRecord vlr) throws IOException
vlr
- a valid instanceIOException
- in the event of an unrecoverable I/O error.public double[] readVariableLengthRecordDoubles(LasVariableLengthRecord vlr) throws IOException
vlr
- a valid instanceIOException
- in the event of an unrecoverable I/O error.public boolean usesGeographicCoordinates()
public LasGpsTimeType getLasGpsTimeType()
public GeoTiffData getGeoTiffData()
public LinearUnits getLinearUnits()
public LasScaleAndOffset getScaleAndOffset()
Copyright © 2021. All rights reserved.