Class WKTFileReader
Reads a sequence of Geometrys in WKT format from a text file.
Inherited Members
Namespace: NetTopologySuite.IO
Assembly: NetTopologySuite.dll
Syntax
public class WKTFileReader
Remarks
The geometries in the file may be separated by any amount of whitespace and newlines.
Constructors
| Improve this Doc View SourceWKTFileReader(FileInfo, WKTReader)
Creates a new WKTFileReader given the file
to read from and a WKTReader to use to parse the geometries.
Declaration
public WKTFileReader(FileInfo file, WKTReader wktReader)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file | the FileInfo to read from |
WKTReader | wktReader | the geometry reader to use |
WKTFileReader(Stream, WKTReader)
Creates a new WKTFileReader, given a Stream to read from.
Declaration
public WKTFileReader(Stream stream, WKTReader wktReader)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to read from |
WKTReader | wktReader | The geometry reader to use |
WKTFileReader(TextReader, WKTReader)
Creates a new WKTFileReader, given a TextReader to read with.
Declaration
public WKTFileReader(TextReader reader, WKTReader wktReader)
Parameters
Type | Name | Description |
---|---|---|
TextReader | reader | The stream reader of the file to read from |
WKTReader | wktReader | The geometry reader to use |
WKTFileReader(String, WKTReader)
Creates a new WKTFileReader, given the name of the file to read from.
Declaration
public WKTFileReader(string filename, WKTReader wktReader)
Parameters
Type | Name | Description |
---|---|---|
String | filename | The name of the file to read from |
WKTReader | wktReader | The geometry reader to use |
Properties
| Improve this Doc View SourceLimit
Gets/Sets the maximum number of geometries to read.
Declaration
public int Limit { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Offset
Gets/Sets the number of geometries to skip before reading.
Declaration
public int Offset { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
StrictParsing
Gets/Sets allow ignoring WKT parse errors after at least one geometry has been read, to return a partial result.
Declaration
public bool StrictParsing { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceRead()
Reads a sequence of geometries.
Declaration
public IList<Geometry> Read()
Returns
Type | Description |
---|---|
IList<Geometry> | The list of geometries read |
Remarks
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.
Exceptions
Type | Condition |
---|---|
IOException | Thrown if an I/O exception was encountered |
ParseException | Thrown if an error occurred reading a geometry |