public class ShapefileReader extends Object implements Closeable
Constructor and Description |
---|
ShapefileReader(File file) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the associated file
|
File |
getCoFile(String extension)
Get a reference to the file that shares the same root name as the Shapefile
but has an alternate extension.
|
DbfFileReader |
getDbfFileReader()
Get an DBF file reader for the current Shapefile
|
File |
getFile()
Get the file associated with the Shapefile.
|
long |
getFilePosition()
Provides the current position within the main Shapefile.
|
long |
getFileSize()
Gets the current size of the main Shapefile in bytes.
|
double |
getMaxX()
Gets the maximum value for the x coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
double |
getMaxY()
Gets the maximum value for the y coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
double |
getMaxZ()
Gets the maximum value for the z coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
double |
getMinX()
Gets the minimum value for the x coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
double |
getMinY()
Gets the minimum value for the y coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
double |
getMinZ()
Gets the minimum value for the z coordinates of the points in the Shapefile
as specified in the Shapefile-standard file header.
|
ShapefileType |
getShapefileType()
Get the feature type of the Shapefile.
|
int |
getTotalPartCount()
Gets the total number of polyglines read from the Shapefile; or zero if the
content of the Shapefile hasn't been read.
|
int |
getTotalPointCount()
Gets the total number of points read from the Shapefile; or zero if the
content of the Shapefile hasn't been read.
|
boolean |
hasNext()
Checks to see if there are any more records remaining to be read
|
ShapefileRecord |
readNextRecord(ShapefileRecord pRecord)
Reads the next record in the Shapefile.
|
String |
toString() |
public ShapefileReader(File file) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- in the event of an unexpected I/O exceptionpublic double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
public double getMinZ()
public double getMaxZ()
public ShapefileRecord readNextRecord(ShapefileRecord pRecord) throws IOException
pRecord
- a reusable instance to store data, or a null if the method
is to allocate a new instance.IOException
- in the event of a file format error or unepected I/O
conditionpublic boolean hasNext()
public int getTotalPointCount()
public int getTotalPartCount()
public ShapefileType getShapefileType()
public File getCoFile(String extension)
Capitalization does not matter under Windows, but does apply under Linux operating systems. Therefore, this method will try to find the matching file based on the following three rules:
extension
- a string giving the target extension (do not include period)public DbfFileReader getDbfFileReader() throws IOException
IOException
- if the DBF file cannot be openedpublic File getFile()
public long getFileSize()
public long getFilePosition()
Copyright © 2021. All rights reserved.