com.esri.arcgis.geodatabaseextensions
Class LasFile

java.lang.Object
  extended by com.esri.arcgis.geodatabaseextensions.LasFile
All Implemented Interfaces:
IGeoDataset, ILasFile, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class LasFile
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGeoDataset, ILasFile

Esri LasFile object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
LasFile(Object obj)
          Construct a LasFile using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 double estimatePointCount(IGeometry pAOI)
          Estimate point count.
 double estimatePointSpacing(boolean bUseStatistics)
          Estimate point spacing.
 IEnvelope getExtent()
          The extent of the GeoDataset.
 ILasHeaderInfo getHeaderInfo()
          Get LAS file header information.
 String getName()
          The (full) file name.
 ISpatialReference getNativeSpatialReference()
          The spatial reference defined in the LAS file header.
 double getNumberOfPointRecords()
          The number of points in the LAS file.
 double getNumberOfPointsByReturn(int returnNumber)
          The number of points in the LAS file based on the specified LiDAR return number.
 int getPointDataFormat()
          The record format for points in the LAS file
 double getSizeInBytes()
          The LAS file's size in bytes.
 ISpatialReference getSpatialReference()
          The spatial reference of the GeoDataset.
 ILasStatistics getStatistics()
          Get statistics.
 void getVersion(int[] pMajor, int[] pMinor)
          The version of the LAS file.
 int hashCode()
          the hashcode for this object
 boolean isFileMissing()
          Indicates if the LAS file is missing.
 boolean isFileValid()
          Indicates if the LAS file exists and is valid.
 boolean isHasGpsTime()
          Indicates GPS time is available.
 boolean isHasPrjFile()
          Indicates if there is a corresponding PRJ file.
 boolean isHasRGB()
          Indicates if RGB is availabe.
 boolean isHasStatistics()
          Indicates if statistics is available.
 boolean isNeedsUpdateStatistics()
          Indicates if update is necessary.
 boolean isStandardGpsTime()
          Indicates if the GPS time is standard GPS Time.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

LasFile

public LasFile(Object obj)
        throws IOException
Construct a LasFile using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to LasFile.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
LasFile o = (LasFile)obj; // will not work

LasFile o = new LasFile(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems LasFile theLasFile = (LasFile) obj;
Method Detail

equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getSpatialReference

public ISpatialReference getSpatialReference()
                                      throws IOException,
                                             AutomationException
The spatial reference of the GeoDataset.

Remarks

This property is read only. For layers, when the first layer is added to ArcMap, its spatial reference is read by this property, and the map is set to this spatial reference.

Instances of the esriCarto.GroupLayer class will return null for this property, as a group layer can contain multiple datasets with different spatial references.

Modifications to a spatial reference returned by this property will not be persisted. To modify the spatial reference of a dataset, the IGeoDatasetSchemaEdit and IGeoDatasetSchemaEdit2 interfaces should be used.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSpatialReference in interface IGeoDataset
Specified by:
getSpatialReference in interface ILasFile
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getExtent

public IEnvelope getExtent()
                    throws IOException,
                           AutomationException
The extent of the GeoDataset.

Remarks

The IGeoDataset::Extent property returns an envelope representing the maximum extent of data which has been stored in the dataset.

Consider the following scenario. A new feature class has features added to it. The IGeoDataset::Extent is then requested and an envelope is returned. The extents of the envelope returned are represented by the red box in the image below.

The red box represents the IGeoDataset extent

If a portion of the features were then deleted and the extent is again requested an envelope with the exact same extents as during the first request would be returned (see image below). This is because the deletion of features does not shrink the extent. However all additions of features outside the red box would increase the envelope returned to encompass the newly added features.

The red box represents the IGeoDataset extent after some of the features have been deleted

If you would like to update the IGeoDataset::Extent property to reflect the current features in your dataset please see IFeatureClassManage::UpdateExtent (also see IFeatureClassLoad). In the image below the extent has been updated and a new envelope is being returned.

The red box represents the IGeoDataset extent after it has been updated

ESRI's GroupLayer implements this property differently from most other layer coclasses. When you instantiate a new GroupLayer, this property will return a valid envelope with zero height and width. With most other newly instantiated layers (for example FeatureLayer, RasterLayer, TinLayer), this property initally returns Nothing.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getExtent in interface IGeoDataset
Specified by:
getExtent in interface ILasFile
Returns:
A reference to a com.esri.arcgis.geometry.IEnvelope
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
The (full) file name.

Description

The full name of the las file including the path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getName in interface ILasFile
Returns:
The pName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVersion

public void getVersion(int[] pMajor,
                       int[] pMinor)
                throws IOException,
                       AutomationException
The version of the LAS file.

Description

Outputs the version of the las file to pMajor and pMinor. The version is based on the standard as defined in the LAS specification.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getVersion in interface ILasFile
Parameters:
pMajor - The pMajor (out: use single element array)
pMinor - The pMinor (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPointDataFormat

public int getPointDataFormat()
                       throws IOException,
                              AutomationException
The record format for points in the LAS file

Description

The point record format used in the las file, as based on the LAS specification.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getPointDataFormat in interface ILasFile
Returns:
The pFormat
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNumberOfPointRecords

public double getNumberOfPointRecords()
                               throws IOException,
                                      AutomationException
The number of points in the LAS file.

Description

The total number of point records in the las file regardless of return type or classification.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getNumberOfPointRecords in interface ILasFile
Returns:
The pcRecords
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNumberOfPointsByReturn

public double getNumberOfPointsByReturn(int returnNumber)
                                 throws IOException,
                                        AutomationException
The number of points in the LAS file based on the specified LiDAR return number.

Description

The number of points in the las file with the specified return.

returnNumber is the return for which you want to get a count. The valid range is 1-5.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getNumberOfPointsByReturn in interface ILasFile
Parameters:
returnNumber - The returnNumber (in)
Returns:
The pcPoints
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeInBytes

public double getSizeInBytes()
                      throws IOException,
                             AutomationException
The LAS file's size in bytes.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSizeInBytes in interface ILasFile
Returns:
The pcBytes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasRGB

public boolean isHasRGB()
                 throws IOException,
                        AutomationException
Indicates if RGB is availabe.

Description

Indicates whether the las file contains RGB values for all points.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isHasRGB in interface ILasFile
Returns:
The pbHasRGB
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasGpsTime

public boolean isHasGpsTime()
                     throws IOException,
                            AutomationException
Indicates GPS time is available.

Description

Indicates whether the las file contains GPS time stamps for all points.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isHasGpsTime in interface ILasFile
Returns:
The pbHasGpsTime
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isStandardGpsTime

public boolean isStandardGpsTime()
                          throws IOException,
                                 AutomationException
Indicates if the GPS time is standard GPS Time.

Description

Assumming the las file contains GPS time stamps (see ILasFile.HasGpsTime) a return value of FALSE means the values are in GPS weekly time. A return value of TRUE means standard GPS time (satellite GPS Time) minus 1 x 10 to the 9th (Adjusted Standard GPS Time). The offset moves the time back to near zero to improve floating point resolution.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isStandardGpsTime in interface ILasFile
Returns:
The pbIsAStandard
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNativeSpatialReference

public ISpatialReference getNativeSpatialReference()
                                            throws IOException,
                                                   AutomationException
The spatial reference defined in the LAS file header.

Description

Returns the spatial reference as defined by the contents of the referenced LAS file. A NULL pointer is returned if no spatial reference is defined. Note, it's possible through the use of a prj file to define, or override, the spatial reference of a LAS file. The NativeSpatialReference only tells you what's in the LAS file, not what spatial reference ArcGIS is using for it. To determine that call ILasFile.SpatialReference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getNativeSpatialReference in interface ILasFile
Returns:
A reference to a com.esri.arcgis.geometry.ISpatialReference
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFileMissing

public boolean isFileMissing()
                      throws IOException,
                             AutomationException
Indicates if the LAS file is missing.

Description

Returns TRUE if the referenced LAS file can't be found on disk.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isFileMissing in interface ILasFile
Returns:
The pbIsMissing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isFileValid

public boolean isFileValid()
                    throws IOException,
                           AutomationException
Indicates if the LAS file exists and is valid.

Description

Returns TRUE if the referenced file can be found on disk and a scan of its header indicates it's a valid LAS file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isFileValid in interface ILasFile
Returns:
The pbIsValid
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasPrjFile

public boolean isHasPrjFile()
                     throws IOException,
                            AutomationException
Indicates if there is a corresponding PRJ file.

Description

Returns TRUE if the referenced LAS file has a corrseponding prj file. This is an ArcGIS file, placed next to the LAS file, that uses the same base name as the LAS file but has the extension '.prj'. Prj files contain spatial reference information. If ArcGIS looks to a LAS file and finds a prj next to it, the spatial reference from the prj will take precedence over what's in the LAS file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isHasPrjFile in interface ILasFile
Returns:
The pbHasPRJ
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasStatistics

public boolean isHasStatistics()
                        throws IOException,
                               AutomationException
Indicates if statistics is available.

Description

Indicates whether the las dataset has calculated statistics for the las file. Check ILasFile.NeedsUpdateStatistics to see if the statistics are current or outdated because of edits made to the las file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isHasStatistics in interface ILasFile
Returns:
The pbHasStats
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isNeedsUpdateStatistics

public boolean isNeedsUpdateStatistics()
                                throws IOException,
                                       AutomationException
Indicates if update is necessary.

Description

NeedsUpdateStatistics returns TRUE if statistics have yet to be calculated for the las file or if the statistics are outdated due to edits made on the file. Whether or not the file has been edited is determined by two things: either the las dataset knows it made an edit because it was called to do it (via a ILasPointEdit method) or the las dataset has detected the timestamp of the file has changed relative to what it was when added to the las dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isNeedsUpdateStatistics in interface ILasFile
Returns:
The pbNeedsUpdate
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStatistics

public ILasStatistics getStatistics()
                             throws IOException,
                                    AutomationException
Get statistics.

Description

Returns the statistics for the las file. NULL is returned if statistics haven't been calculated. You can also check for statistics using ILasFile.HasStatistics.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getStatistics in interface ILasFile
Returns:
A reference to a com.esri.arcgis.geodatabaseextensions.ILasStatistics
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHeaderInfo

public ILasHeaderInfo getHeaderInfo()
                             throws IOException,
                                    AutomationException
Get LAS file header information.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getHeaderInfo in interface ILasFile
Returns:
A reference to a com.esri.arcgis.geodatabaseextensions.ILasHeaderInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

estimatePointSpacing

public double estimatePointSpacing(boolean bUseStatistics)
                            throws IOException,
                                   AutomationException
Estimate point spacing.

Description

Returns the approximate horizontal post spacing of the points in the las file. The unit of the returned value is based on the XY coordinate system of the file.

bUseStatistics is used to specify which way to calculate the estimate. When set to FALSE a simple approximation is made using the total points in the las file against the XY extent declared in the header. This approach's accuracy is relative to how evenly distributed the points are over the entire extent. The more evenly distributed, the more accurate. When bUseStatistics is set to TRUE statistics are used for the estimate. This will generally be more accurate but requires that statistics have already been generated (see ILasDatasetEdit.CalculateFileStatistics and ILasDatasetEdit.CalculateStatistics) which requires a scan of the data. An error will result if this property is set to TRUE and statistics have not been made.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
estimatePointSpacing in interface ILasFile
Parameters:
bUseStatistics - The bUseStatistics (in)
Returns:
The pSpacing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

estimatePointCount

public double estimatePointCount(IGeometry pAOI)
                          throws IOException,
                                 AutomationException
Estimate point count.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
estimatePointCount in interface ILasFile
Parameters:
pAOI - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Returns:
The pcPoints
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.