NetTopologySuite
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
NetTopologySuite.IO.WKBReader Class Reference

Converts a Well-Known Binary byte data to a Geometry. More...

Inheritance diagram for NetTopologySuite.IO.WKBReader:
NetTopologySuite.IO.MsSqlSpatialReader

Public Member Functions

 WKBReader ()
 Initialize reader with a standard IGeometryFactory. More...
 
 WKBReader (IGeometryFactory factory)
 Initialize reader with the given GeometryFactory. More...
 
 WKBReader (IGeometryServices services)
 
IGeometry Read (byte[] data)
 Reads a IGeometry in binary WKB format from an array of bytes. More...
 
virtual IGeometry Read (Stream stream)
 Reads a IGeometry in binary WKB format from an Stream. More...
 

Static Public Member Functions

static byte[] HexToBytes (String hex)
 Converts a hexadecimal string to a byte array. The hexadecimal digit symbols are case-insensitive. /summary>

Parameters
hexA string containing hex digits
Returns
An array of bytes with the value of the hex string

 

Protected Types

enum  CoordinateSystem { XY = 1, XYZ = 2, XYM = 3, XYZM = 4 }
 

Protected Member Functions

IGeometry Read (BinaryReader reader)
 
ICoordinateSequence ReadCoordinateSequence (BinaryReader reader, int size, CoordinateSystem cs)
 Function to read a coordinate sequence. More...
 
ICoordinateSequence ReadCoordinateSequenceRing (BinaryReader reader, int size, CoordinateSystem cs)
 Function to read a coordinate sequence that is supposed to form a ring. More...
 
ICoordinateSequence ReadCoordinateSequenceLineString (BinaryReader reader, int size, CoordinateSystem cs)
 Function to read a coordinate sequence that is supposed to serve a line string. More...
 
ILinearRing ReadLinearRing (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a ILinearRing geometry. More...
 
IGeometry ReadPoint (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IPoint geometry. More...
 
IGeometry ReadLineString (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a ILineString geometry. More...
 
IGeometry ReadPolygon (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IPolygon geometry. More...
 
IGeometry ReadMultiPoint (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IMultiPoint geometry. More...
 
IGeometry ReadMultiLineString (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IMultiLineString geometry. More...
 
IGeometry ReadMultiPolygon (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IMultiPolygon geometry. More...
 
IGeometry ReadGeometryCollection (BinaryReader reader, CoordinateSystem cs, int srid)
 Reads a IGeometryCollection geometry. More...
 

Properties

IGeometryFactory Factory [get]
 The IGeometry builder. More...
 
bool HandleSRID [get, set]
 
Ordinates AllowedOrdinates [get]
 
Ordinates HandleOrdinates [get, set]
 
bool RepairRings [get, set]
 Gets or sets whether invalid linear rings should be fixed More...
 

Detailed Description

Converts a Well-Known Binary byte data to a Geometry.

The reader repairs structurally-invalid input (specifically, LineStrings and LinearRings which contain too few points have vertices added, and non-closed rings are closed). s

Constructor & Destructor Documentation

NetTopologySuite.IO.WKBReader.WKBReader ( )

Initialize reader with a standard IGeometryFactory.

NetTopologySuite.IO.WKBReader.WKBReader ( IGeometryFactory  factory)

Initialize reader with the given GeometryFactory.

Parameters
factory

Member Function Documentation

IGeometry NetTopologySuite.IO.WKBReader.Read ( byte[]  data)

Reads a IGeometry in binary WKB format from an array of bytes.

Parameters
dataThe byte array to read from
Returns
The geometry read
Exceptions
GeoAPI.IO.ParseExceptionif the WKB data is ill-formed.
virtual IGeometry NetTopologySuite.IO.WKBReader.Read ( Stream  stream)
virtual

Reads a IGeometry in binary WKB format from an Stream.

Parameters
streamThe stream to read from
Returns
The geometry read
Exceptions
GeoAPI.IO.ParseExceptionif the WKB data is ill-formed.

Reimplemented in NetTopologySuite.IO.MsSqlSpatialReader.

IGeometry NetTopologySuite.IO.WKBReader.Read ( BinaryReader  reader)
protected

Parameters
reader
Returns
ICoordinateSequence NetTopologySuite.IO.WKBReader.ReadCoordinateSequence ( BinaryReader  reader,
int  size,
CoordinateSystem  cs 
)
protected

Function to read a coordinate sequence.

Parameters
readerThe reader
sizeThe number of ordinates
csThe coordinate system
Returns
The read coordinate sequence.
ICoordinateSequence NetTopologySuite.IO.WKBReader.ReadCoordinateSequenceLineString ( BinaryReader  reader,
int  size,
CoordinateSystem  cs 
)
protected

Function to read a coordinate sequence that is supposed to serve a line string.

Parameters
readerThe reader
sizeThe number of ordinates
csThe coordinate system
Returns
The read coordinate sequence.
ICoordinateSequence NetTopologySuite.IO.WKBReader.ReadCoordinateSequenceRing ( BinaryReader  reader,
int  size,
CoordinateSystem  cs 
)
protected

Function to read a coordinate sequence that is supposed to form a ring.

Parameters
readerThe reader
sizeThe number of ordinates
csThe coordinate system
Returns
The read coordinate sequence.
IGeometry NetTopologySuite.IO.WKBReader.ReadGeometryCollection ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IGeometryCollection geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IGeometryCollection geometry

ILinearRing NetTopologySuite.IO.WKBReader.ReadLinearRing ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a ILinearRing geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A ILinearRing geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadLineString ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a ILineString geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A ILineString geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadMultiLineString ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IMultiLineString geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IMultiLineString geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadMultiPoint ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IMultiPoint geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IMultiPoint geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadMultiPolygon ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IMultiPolygon geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IMultiPolygon geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadPoint ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IPoint geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IPoint geometry

IGeometry NetTopologySuite.IO.WKBReader.ReadPolygon ( BinaryReader  reader,
CoordinateSystem  cs,
int  srid 
)
protected

Reads a IPolygon geometry.

Parameters
readerThe reader
csThe coordinate system

param name="srid">The spatial reference id for the geometry.

returns>A IPolygon geometry

Property Documentation

IGeometryFactory NetTopologySuite.IO.WKBReader.Factory
getprotected

The IGeometry builder.

bool NetTopologySuite.IO.WKBReader.RepairRings
getset

Gets or sets whether invalid linear rings should be fixed


The documentation for this class was generated from the following file: