Package org.locationtech.jts.io
Class WKBHexFileReader
java.lang.Object
org.locationtech.jts.io.WKBHexFileReader
Reads a sequence of
Geometry
s in WKBHex format
from a text file.
Each WKBHex geometry must be on a single line
The geometries in the file may be separated by any amount
of whitespace and newlines.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWKBHexFileReader
(File file, WKBReader wkbReader) Creates a new WKBHexFileReader given the File to read from and a WKTReader to use to parse the geometries.WKBHexFileReader
(Reader reader, WKBReader wkbReader) Creates a new WKBHexFileReader, given aReader
to read from.WKBHexFileReader
(String filename, WKBReader wkbReader) Creates a new WKBHexFileReader, given the name of the file to read from. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
isAtEndOfFile
(BufferedReader bufferedReader) Tests if reader is at EOF.private boolean
read()
Reads a sequence of geometries.private List
read
(BufferedReader bufferedReader) void
setLimit
(int limit) Sets the maximum number of geometries to read.void
setOffset
(int offset) Sets the number of geometries to skip before storing.
-
Field Details
-
file
-
reader
-
wkbReader
-
count
private int count -
limit
private int limit -
offset
private int offset -
MAX_LOOKAHEAD
private static final int MAX_LOOKAHEAD- See Also:
-
-
Constructor Details
-
WKBHexFileReader
Creates a new WKBHexFileReader given the File to read from and a WKTReader to use to parse the geometries.- Parameters:
file
- the File to read fromwkbReader
- the geometry reader to use
-
WKBHexFileReader
Creates a new WKBHexFileReader, given the name of the file to read from.- Parameters:
filename
- the name of the file to read fromwkbReader
- the geometry reader to use
-
WKBHexFileReader
Creates a new WKBHexFileReader, given aReader
to read from.- Parameters:
reader
- the reader to read fromwkbReader
- the geometry reader to use
-
-
Method Details
-
setLimit
public void setLimit(int limit) Sets the maximum number of geometries to read.- Parameters:
limit
- the maximum number of geometries to read
-
setOffset
public void setOffset(int offset) Sets the number of geometries to skip before storing.- Parameters:
offset
- the number of geometries to skip
-
read
Reads a sequence of geometries. If an offset is specified, geometries read up to the offset count are skipped. If a limit is specified, no more than limit geometries are read.- Returns:
- the list of geometries read
- Throws:
IOException
- if an I/O exception was encounteredParseException
- if an error occurred reading a geometry
-
read
- Throws:
IOException
ParseException
-
isAtLimit
-
isAtEndOfFile
Tests if reader is at EOF.- Throws:
IOException
-