public class IlvShapeFileIndex extends Object
.shx
files).
.shp
file). Index files map record indexes to file offsets.
Constructor and Description |
---|
IlvShapeFileIndex(DataInput dataInput)
Initializes an
IlvShapeFileIndex from the specified
DataInput . |
IlvShapeFileIndex(String filename)
Initializes an
IlvShapeFileIndex from the .shx
file specified. |
IlvShapeFileIndex(URL url)
Initializes an
IlvShapeFileIndex from the specified URL . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of this object.
|
void |
finalize()
Called by the Java Garbage Collector to release
the resources allocated to the reader.
|
IlvCoordinate |
getLowerRightCorner()
Returns the lower-right corner of the bounding box that delimits the objects
read from the file.
|
double |
getMaxMeasure()
Returns the maximum value of the measurements.
|
double |
getMinMeasure()
Returns the minimum value of the measurements.
|
int |
getRecordCount()
Returns the number of objects in this index.
|
int |
getRecordLength(int index)
Returns the record length (in bytes) of the object at the specified index.
|
long |
getRecordOffset(int index)
Returns the file offset of the object at the specified index.
|
IlvCoordinate |
getUpperLeftCorner()
Returns the upper-left corner of the bounding box that delimits the objects
read from the file.
|
double |
getZMax()
Returns the maximum elevation.
|
double |
getZMin()
Returns the minimum elevation.
|
public IlvShapeFileIndex(String filename) throws IOException, IlvMapFormatException
IlvShapeFileIndex
from the .shx
file specified.
filename
- The name of the .shx
file.IOException
- if an error occurs while opening the file.IlvMapFormatException
- if the file contains a format error.public IlvShapeFileIndex(DataInput dataInput) throws IOException, IlvMapFormatException
IlvShapeFileIndex
from the specified
DataInput
.
dataInput
- The data input containing the shape data.IOException
- if an error occurs while reading the input stream.IlvMapFormatException
- if the file contains a format error.public IlvShapeFileIndex(URL url) throws IOException, IlvMapFormatException
IlvShapeFileIndex
from the specified URL
.url
- The data url pointing to the shape data.IlvMapFormatException
- if the file contains a format error.IOException
public void dispose()
public void finalize()
dispose
method
was not called, it releases the resources used by the reader.public long getRecordOffset(int index) throws IOException, UnsupportedOperationException
100
bytes header in the .shp
file, the index of the first object
is at offset 100
.index
- The index of the object.IOException
- if an error occurs when reading from the file.UnsupportedOperationException
- if index
leads to a negative
skip in the input file and the input file is not a random access file.public int getRecordLength(int index) throws IOException, UnsupportedOperationException
index
- The index of the object.IOException
- if an error occurs when reading from the file.UnsupportedOperationException
- if index
leads to a negative
skip in the input file and the input file is not a random access file.public IlvCoordinate getUpperLeftCorner()
public IlvCoordinate getLowerRightCorner()
public double getZMin()
public double getZMax()
public double getMinMeasure()
public double getMaxMeasure()
public int getRecordCount()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.