Package com.microsoft.sqlserver.jdbc

# Class Geography

java.lang.Object
com.microsoft.sqlserver.jdbc.Geography

    public class Geography
    extends java.lang.Object

Geography datatype represents data in a round-earth coordinate system. This class will stay in this current package for backwards compatibility.

## Field Summary

Fields
Modifier and Type | Field | Description
--- | --- | ---
`protected java.nio.ByteBuffer` | `buffer` | As a general rule, the ~IndexEnd variables are non-inclusive (i.e.
`protected int` | `currentFigureIndex` |
`protected int` | `currentPointIndex` |
`protected int` | `currentSegmentIndex` |
`protected int` | `currentShapeIndex` |
`protected int` | `currentWktPos` |
`protected byte` | `FA_ARC` |
`protected byte` | `FA_COMPOSITE_CURVE` |
`protected byte` | `FA_EXTERIOR_RING` |
`protected byte` | `FA_INTERIOR_RING` |
`protected byte` | `FA_LINE` |
`protected byte` | `FA_POINT` |
`protected byte` | `FA_STROKE` |
`protected java.util.List<Figure>` | `figureList` |
`protected Figure[]` | `figures` |
`protected boolean` | `hasMvalues` |
`protected boolean` | `hasZvalues` |
`protected InternalSpatialDatatype` | `internalType` |
`protected boolean` | `isLargerThanHemisphere` |
`protected boolean` | `isNull` |
`protected boolean` | `isSingleLineSegment` |
`protected boolean` | `isSinglePoint` |
`protected boolean` | `isValid` |
`protected double[]` | `mValues` |
`protected int` | `numberOfFigures` |
`protected int` | `numberOfPoints` |
`protected int` | `numberOfSegments` |
`protected int` | `numberOfShapes` |
`protected java.util.List<Point>` | `pointList` |
`protected java.util.List<Segment>` | `segmentList` |
`protected Segment[]` | `segments` |
`protected byte` | `serializationProperties` |
`protected java.util.List<Shape>` | `shapeList` |
`protected Shape[]` | `shapes` |
`protected int` | `srid` |
`protected byte` | `version` |
`protected byte[]` | `wkb` |
`protected byte[]` | `wkbNoZM` |
`protected java.lang.String` | `wkt` |
`protected java.lang.String` | `wktNoZM` |
`protected java.lang.StringBuffer` | `WKTsb` |
`protected java.lang.StringBuffer` | `WKTsbNoZM` |
`protected double[]` | `xValues` |
`protected double[]` | `yValues` |
`protected double[]` | `zValues` |

## Constructor Summary

Constructors
Modifier | Constructor | Description
--- | --- | ---
`protected` | `Geography()` |
`protected` | `Geography​(byte[] wkb)` | Private constructor used for creating a Geography object from WKB.
`protected` | `Geography​(java.lang.String wkt, int srid)` | Private constructor used for creating a Geography object from WKT and Spatial Reference Identifier.

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`protected void` | `appendToWKTBuffers​(java.lang.Object o)` | Append the data to both stringbuffers.
`java.lang.String` | `asTextZM()` | Returns the Well-Known Text (WKT) representation of the Geography object.
`protected boolean` | `checkEmptyKeyword​(int parentShapeIndex, InternalSpatialDatatype isd, boolean isInsideAnotherShape)` |
`protected void` | `constructCompoundcurveWKT​(int segmentStartIndex, int segmentEndIndex, int pointEndIndex)` | Constructs a CompoundCurve in WKT form.
`protected void` | `constructCurvepolygonWKT​(int figureStartIndex, int figureEndIndex, int segmentStartIndex, int segmentEndIndex)` | Constructs a CurvePolygon in WKT form.
`protected void` | `constructGeometryCollectionWKT​(int shapeEndIndex)` | The starting point for constructing a GeometryCollection type in WKT form.
`protected void` | `constructLineWKT​(int pointStartIndex, int pointEndIndex)` | Constructs a line in WKT form.
`protected void` | `constructMultipolygonWKT​(int shapeStartIndex, int shapeEndIndex)` | Constructs a MultiPolygon in WKT form.
`protected void` | `constructMultiShapeWKT​(int shapeStartIndex, int shapeEndIndex)` | Constructs a mutli-shape (MultiPoint / MultiLineString) in WKT form.
`protected void` | `constructPointWKT​(int pointIndex)` | Constructs and appends a Point type in WKT form to the stringbuffer.
`protected void` | `constructSegmentWKT​(int currentSegment, byte segment, int pointEndIndex)` | Constructs a Segment in WKT form.
`protected void` | `constructShapeWKT​(int figureStartIndex, int figureEndIndex)` | Constructs a shape (simple Geometry/Geography entities that are contained within a single bracket) in WKT form.
`protected void` | `constructWKT​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, InternalSpatialDatatype isd, int pointIndexEnd, int figureIndexEnd, int segmentIndexEnd, int shapeIndexEnd)` | Constructs the WKT representation of Geometry/Geography from the deserialized data.
`protected void` | `createSerializationProperties()` |
`static Geography` | `deserialize​(byte[] wkb)` | Constructor for a Geography instance from an internal SQL Server format for spatial data.
`protected void` | `determineInternalType()` |
`protected int` | `determineWkbCapacity​(boolean excludeZMFromWKB)` |
`java.util.List<Figure>` | `getFigureList()` |
`java.lang.Double` | `getLatitude()` | Returns the latitude value.
`java.lang.Double` | `getLongitude()` | Returns the longitude value.
`java.lang.Double` | `getM()` | Returns the M (measure) value of the object.
`protected java.lang.String` | `getNextStringToken()` | Reads the next string token (usually POINT, LINESTRING, etc.).
`java.util.List<Point>` | `getPointList()` |
`java.util.List<Segment>` | `getSegmentList()` |
`java.util.List<Shape>` | `getShapeList()` |
`int` | `getSrid()` | Returns the Spatial Reference Identifier (SRID) value.
`java.lang.Double` | `getZ()` | Returns the Z (elevation) value of the object.
`boolean` | `hasM()` | Returns if the object contains a M (measure) value.
`protected boolean` | `hasMoreToken()` |
`boolean` | `hasZ()` | Returns if the object contains a Z (elevation) value.
`protected void` | `interpretSerializationPropBytes()` |
`boolean` | `isNull()` | Returns if the Geography object is null.
`static Geography` | `parse​(java.lang.String wkt)` | Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation.
`protected void` | `parseWkb​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype type)` | Deserializes the buffer (that contains WKB representation of Geometry/Geography data), and stores it into multiple corresponding data structures.
`protected void` | `parseWKTForSerialization​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, int startPos, int parentShapeIndex, boolean isGeoCollection)` | Parses WKT and populates the data structures of the Geometry/Geography instance.
`static Geography` | `point​(double lat, double lon, int srid)` | Constructor for a Geography instance that represents a Point instance from its latitude and longitude values and a Spatial Reference Identifier.
`protected void` | `populateStructures()` | Populates the various data structures contained within the Geometry/Geography instance.
`protected byte` | `readByte()` |
`protected void` | `readCloseBracket()` |
`protected void` | `readCompoundCurveWkt​(boolean isFirstIteration)` | Reads a CompoundCurve WKT.
`protected void` | `readCurvePolygon()` | Reads a CurvePolygon WKT.
`protected double` | `readDouble()` |
`protected void` | `readFigures()` |
`protected int` | `readInt()` |
`protected void` | `readLineWkt()` | Reads a series of Point types.
`protected void` | `readMultiPolygonWkt​(int thisShapeIndex, java.lang.String nextToken)` | Reads a MultiPolygon WKT.
`protected void` | `readMvalues()` |
`protected void` | `readNumberOfFigures()` |
`protected void` | `readNumberOfPoints()` |
`protected void` | `readNumberOfSegments()` |
`protected void` | `readNumberOfShapes()` |
`protected void` | `readOpenBracket()` |
`protected void` | `readPointWkt()` | Reads Point WKT and adds it to the list of points.
`protected void` | `readSegments()` |
`protected void` | `readSegmentWkt​(int segmentType, boolean isFirstIteration)` | Reads a Segment WKT.
`protected void` | `readShapes()` |
`protected void` | `readShapeWkt​(int parentShapeIndex, java.lang.String nextToken)` | Reads a shape (simple Geometry/Geography entities that are contained within a single bracket) WKT.
`protected void` | `readZvalues()` |
`byte[]` | `serialize()` | Returns the bytes that represent an internal SQL Server format of Geography type.
`protected void` | `serializeToWkb​(boolean excludeZMFromWKB, com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype type)` | Serializes the Geogemetry/Geography instance to WKB.
`byte[]` | `STAsBinary()` | Returns the Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation of a Geography instance.
`java.lang.String` | `STAsText()` | Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a Geography instance.
`java.lang.String` | `STGeographyType()` | Returns the Open Geospatial Consortium (OGC) type name represented by a Geography instance.
`static Geography` | `STGeomFromText​(java.lang.String wkt, int srid)` | Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation augmented with any Z (elevation) and M (measure) values carried by the instance.
`static Geography` | `STGeomFromWKB​(byte[] wkb)` | Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation.
`int` | `STNumPoints()` | Returns the number of points in the Geography object.
`protected void` | `throwIllegalWKB()` |
`protected void` | `throwIllegalWKT()` |
`java.lang.String` | `toString()` | Returns the String representation of the Geography object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### buffer

protected java.nio.ByteBuffer buffer
As a general rule, the ~IndexEnd variables are non-inclusive (i.e. pointIndexEnd = 8 means the shape using it will only go up to the 7th index of the array)

### internalType

protected InternalSpatialDatatype internalType

### wkt

protected java.lang.String wkt

### wktNoZM

protected java.lang.String wktNoZM

### wkb

protected byte[] wkb

### wkbNoZM

protected byte[] wkbNoZM

### srid

protected int srid

### version

protected byte version

### numberOfPoints

protected int numberOfPoints

### numberOfFigures

protected int numberOfFigures

### numberOfShapes

protected int numberOfShapes

### numberOfSegments

protected int numberOfSegments

### WKTsb

protected java.lang.StringBuffer WKTsb

### WKTsbNoZM

protected java.lang.StringBuffer WKTsbNoZM

### currentPointIndex

protected int currentPointIndex

### currentFigureIndex

protected int currentFigureIndex

### currentSegmentIndex

protected int currentSegmentIndex

### currentShapeIndex

protected int currentShapeIndex

### xValues

protected double[] xValues

### yValues

protected double[] yValues

### zValues

protected double[] zValues

### mValues

protected double[] mValues

### figures

protected Figure[] figures

### shapes

protected Shape[] shapes

### segments

protected Segment[] segments

### hasZvalues

protected boolean hasZvalues

### hasMvalues

protected boolean hasMvalues

### isValid

protected boolean isValid

### isSinglePoint

protected boolean isSinglePoint

### isSingleLineSegment

protected boolean isSingleLineSegment

### isLargerThanHemisphere

protected boolean isLargerThanHemisphere

### isNull

protected boolean isNull

### FA_INTERIOR_RING

protected final byte FA_INTERIOR_RING

See Also:
  Constant Field Values

### FA_STROKE

protected final byte FA_STROKE

See Also:
  Constant Field Values

### FA_EXTERIOR_RING

protected final byte FA_EXTERIOR_RING

See Also:
  Constant Field Values

### FA_POINT

protected final byte FA_POINT

See Also:
  Constant Field Values

### FA_LINE

protected final byte FA_LINE

See Also:
  Constant Field Values

### FA_ARC

protected final byte FA_ARC

See Also:
  Constant Field Values

### FA_COMPOSITE_CURVE

protected final byte FA_COMPOSITE_CURVE

See Also:
  Constant Field Values

### currentWktPos

protected int currentWktPos

### pointList

protected java.util.List<Point> pointList

### figureList

protected java.util.List<Figure> figureList

### shapeList

protected java.util.List<Shape> shapeList

### segmentList

protected java.util.List<Segment> segmentList

### serializationProperties

protected byte serializationProperties

## Constructor Details

### Geography

protected Geography()

### Geography

protected Geography​(java.lang.String wkt, int srid) throws SQLServerException
Private constructor used for creating a Geography object from WKT and Spatial Reference Identifier.

Parameters:
  `wkt` - Well-Known Text (WKT) provided by the user.
  `srid` - Spatial Reference Identifier (SRID) provided by the user.
Throws:
  `SQLServerException` - if an exception occurs

### Geography

protected Geography​(byte[] wkb) throws SQLServerException
Private constructor used for creating a Geography object from WKB.

Parameters:
  `wkb` - Well-Known Binary (WKB) provided by the user.
Throws:
  `SQLServerException` - if an exception occurs

## Method Details

### STGeomFromText

public static Geography STGeomFromText​(java.lang.String wkt, int srid) throws SQLServerException
Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation augmented with any Z (elevation) and M (measure) values carried by the instance.

Parameters:
  `wkt` - Well-Known Text (WKT) provided by the user.
  `srid` - Spatial Reference Identifier (SRID) provided by the user.
Returns:
  Geography Geography instance created from WKT and SRID
Throws:
  `SQLServerException` - if an exception occurs

### STGeomFromWKB

public static Geography STGeomFromWKB​(byte[] wkb) throws SQLServerException
Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation.

Parameters:
  `wkb` - Well-Known Binary (WKB) provided by the user.
Returns:
  Geography Geography instance created from WKB
Throws:
  `SQLServerException` - if an exception occurs

### deserialize

public static Geography deserialize​(byte[] wkb) throws SQLServerException
Constructor for a Geography instance from an internal SQL Server format for spatial data.

Parameters:
  `wkb` - Well-Known Binary (WKB) provided by the user.
Returns:
  Geography Geography instance created from WKB
Throws:
  `SQLServerException` - if an exception occurs

### parse

public static Geography parse​(java.lang.String wkt) throws SQLServerException
Constructor for a Geography instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation. Spatial Reference Identifier is defaulted to 4326.

Parameters:
  `wkt` - Well-Known Text (WKT) provided by the user.
Returns:
  Geography Geography instance created from WKT
Throws:
  `SQLServerException` - if an exception occurs

### point

public static Geography point​(double lat, double lon, int srid) throws SQLServerException
Constructor for a Geography instance that represents a Point instance from its latitude and longitude values and a Spatial Reference Identifier.

Parameters:
  `lat` - latitude
  `lon` - longitude
  `srid` - Spatial Reference Identifier value
Returns:
  Geography Geography instance
Throws:
  `SQLServerException` - if an exception occurs

### STAsText

public java.lang.String STAsText() throws SQLServerException
Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a Geography instance. This text will not contain any Z (elevation) or M (measure) values carried by the instance.

Returns:
  the WKT representation without the Z and M values.
Throws:
  `SQLServerException` - if an exception occurs

### STAsBinary

public byte[] STAsBinary()
Returns the Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation of a Geography instance. This value will not contain any Z or M values carried by the instance.

Returns:
  byte array representation of the Geography object.

### serialize

public byte[] serialize()
Returns the bytes that represent an internal SQL Server format of Geography type.

Returns:
  byte array representation of the Geography object.

### hasM

public boolean hasM()
Returns if the object contains a M (measure) value.

Returns:
  boolean that indicates if the object contains M value.

### hasZ

public boolean hasZ()
Returns if the object contains a Z (elevation) value.

Returns:
  boolean that indicates if the object contains Z value.

### getLatitude

public java.lang.Double getLatitude()
Returns the latitude value.

Returns:
  double value that represents the latitude.

### getLongitude

public java.lang.Double getLongitude()
Returns the longitude value.

Returns:
  double value that represents the longitude.

### getM

public java.lang.Double getM()
Returns the M (measure) value of the object.

Returns:
  double value that represents the M value.

### getZ

public java.lang.Double getZ()
Returns the Z (elevation) value of the object.

Returns:
  double value that represents the Z value.

### getSrid

public int getSrid()
Returns the Spatial Reference Identifier (SRID) value.

Returns:
  int value of SRID.

### isNull

public boolean isNull()
Returns if the Geography object is null.

Returns:
  boolean that indicates if the object is null.

### STNumPoints

public int STNumPoints()
Returns the number of points in the Geography object.

Returns:
  int that indicates the number of points in the Geography object.

### STGeographyType

public java.lang.String STGeographyType()
Returns the Open Geospatial Consortium (OGC) type name represented by a Geography instance.

Returns:
  String that contains the Geography object's type name

### asTextZM

public java.lang.String asTextZM()
Returns the Well-Known Text (WKT) representation of the Geography object.

Returns:
  String that contains the WKT representation of the Geography object.

### toString

public java.lang.String toString()
Returns the String representation of the Geography object.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  String that contains the WKT representation of the Geography object.

### serializeToWkb

protected void serializeToWkb​(boolean excludeZMFromWKB, com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype type)
Serializes the Geogemetry/Geography instance to WKB.

Parameters:
  `excludeZMFromWKB` - flag to indicate if Z and M coordinates should be excluded from the WKB representation
  `type` - Type of Spatial Datatype (Geometry/Geography)

### parseWkb

protected void parseWkb​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype type) throws SQLServerException
Deserializes the buffer (that contains WKB representation of Geometry/Geography data), and stores it into multiple corresponding data structures.

Parameters:
  `type` - Type of Spatial Datatype (Geography/Geometry)
Throws:
  `SQLServerException` - if an Exception occurs

### constructWKT

protected void constructWKT​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, InternalSpatialDatatype isd, int pointIndexEnd, int figureIndexEnd, int segmentIndexEnd, int shapeIndexEnd) throws SQLServerException
Constructs the WKT representation of Geometry/Geography from the deserialized data.

Parameters:
  `sd` - the Geometry/Geography instance.
  `isd` - internal spatial datatype object
  `pointIndexEnd` - upper bound for reading points
  `figureIndexEnd` - upper bound for reading figures
  `segmentIndexEnd` - upper bound for reading segments
  `shapeIndexEnd` - upper bound for reading shapes
Throws:
  `SQLServerException` - if an exception occurs

### parseWKTForSerialization

protected void parseWKTForSerialization​(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, int startPos, int parentShapeIndex, boolean isGeoCollection) throws SQLServerException
Parses WKT and populates the data structures of the Geometry/Geography instance.

Parameters:
  `sd` - the Geometry/Geography instance.
  `startPos` - The index to start from from the WKT.
  `parentShapeIndex` - The index of the parent's Shape in the shapes array. Used to determine this shape's parent.
  `isGeoCollection` - flag to indicate if this is part of a GeometryCollection.
Throws:
  `SQLServerException` - if an exception occurs

### constructPointWKT

protected void constructPointWKT​(int pointIndex)
Constructs and appends a Point type in WKT form to the stringbuffer. There are two stringbuffers - WKTsb and WKTsbNoZM. WKTsb contains the X, Y, Z and M coordinates, whereas WKTsbNoZM contains only X and Y coordinates.

Parameters:
  `pointIndex` - indicates which point to append to the stringbuffer.

### constructLineWKT

protected void constructLineWKT​(int pointStartIndex, int pointEndIndex)
Constructs a line in WKT form.

Parameters:
  `pointStartIndex` - .
  `pointEndIndex` - .

### constructShapeWKT

protected void constructShapeWKT​(int figureStartIndex, int figureEndIndex)
Constructs a shape (simple Geometry/Geography entities that are contained within a single bracket) in WKT form.

Parameters:
  `figureStartIndex` - .
  `figureEndIndex` - .

### constructMultiShapeWKT

protected void constructMultiShapeWKT​(int shapeStartIndex, int shapeEndIndex)
Constructs a mutli-shape (MultiPoint / MultiLineString) in WKT form.

Parameters:
  `shapeStartIndex` - .
  `shapeEndIndex` - .

### constructCompoundcurveWKT

protected void constructCompoundcurveWKT​(int segmentStartIndex, int segmentEndIndex, int pointEndIndex)
Constructs a CompoundCurve in WKT form.

Parameters:
  `segmentStartIndex` - .
  `segmentEndIndex` - .
  `pointEndIndex` - .

### constructMultipolygonWKT

protected void constructMultipolygonWKT​(int shapeStartIndex, int shapeEndIndex)
Constructs a MultiPolygon in WKT form.

Parameters:
  `shapeStartIndex` - .
  `shapeEndIndex` - .

### constructCurvepolygonWKT

protected void constructCurvepolygonWKT​(int figureStartIndex, int figureEndIndex, int segmentStartIndex, int segmentEndIndex)
Constructs a CurvePolygon in WKT form.

Parameters:
  `figureStartIndex` - .
  `figureEndIndex` - .
  `segmentStartIndex` - .
  `segmentEndIndex` - .

### constructSegmentWKT

protected void constructSegmentWKT​(int currentSegment, byte segment, int pointEndIndex)
Constructs a Segment in WKT form. SQL Server re-uses the last point of a segment if the following segment is of type 3 (first arc) or type 2 (first line). This makes sense because the last point of a segment and the first point of the next segment have to match for a valid curve. This means that the code has to look ahead and decide to decrement the currentPointIndex depending on what segment comes next, since it may have been reused (and it's reflected in the array of points)

Parameters:
  `currentSegment` - .
  `segment` - .
  `pointEndIndex` - .

### constructGeometryCollectionWKT

protected void constructGeometryCollectionWKT​(int shapeEndIndex) throws SQLServerException
The starting point for constructing a GeometryCollection type in WKT form.

Parameters:
  `shapeEndIndex` - .
Throws:
  `SQLServerException` - if an exception occurs

### readPointWkt

protected void readPointWkt() throws SQLServerException
Reads Point WKT and adds it to the list of points. This method will read up until and including the comma that may come at the end of the Point WKT.

Throws:
  `SQLServerException` - if an exception occurs

### readLineWkt

protected void readLineWkt() throws SQLServerException
Reads a series of Point types.

Throws:
  `SQLServerException` - if an exception occurs

### readShapeWkt

protected void readShapeWkt​(int parentShapeIndex, java.lang.String nextToken) throws SQLServerException
Reads a shape (simple Geometry/Geography entities that are contained within a single bracket) WKT.

Parameters:
  `parentShapeIndex` - shape index of the parent shape that called this method
  `nextToken` - next string token
Throws:
  `SQLServerException` - if an exception occurs

### readCurvePolygon

protected void readCurvePolygon() throws SQLServerException
Reads a CurvePolygon WKT.

Throws:
  `SQLServerException` - if an exception occurs

### readMultiPolygonWkt

protected void readMultiPolygonWkt​(int thisShapeIndex, java.lang.String nextToken) throws SQLServerException
Reads a MultiPolygon WKT.

Parameters:
  `thisShapeIndex` - shape index of current shape
  `nextToken` - next string token
Throws:
  `SQLServerException` - if an exception occurs

### readSegmentWkt

protected void readSegmentWkt​(int segmentType, boolean isFirstIteration) throws SQLServerException
Reads a Segment WKT.

Parameters:
  `segmentType` - segment type
  `isFirstIteration` - flag that indicates if this is the first iteration from the loop outside
Throws:
  `SQLServerException` - if an exception occurs

### readCompoundCurveWkt

protected void readCompoundCurveWkt​(boolean isFirstIteration) throws SQLServerException
Reads a CompoundCurve WKT.

Parameters:
  `isFirstIteration` - flag that indicates if this is the first iteration from the loop outside
Throws:
  `SQLServerException` - if an exception occurs

### getNextStringToken

protected java.lang.String getNextStringToken()
Reads the next string token (usually POINT, LINESTRING, etc.). Then increments currentWktPos to the end of the string token.

Returns:
  the next string token

### populateStructures

protected void populateStructures()
Populates the various data structures contained within the Geometry/Geography instance.

### readOpenBracket

protected void readOpenBracket() throws SQLServerException

Throws:
  `SQLServerException`

### readCloseBracket

protected void readCloseBracket() throws SQLServerException

Throws:
  `SQLServerException`

### hasMoreToken

protected boolean hasMoreToken()

### createSerializationProperties

protected void createSerializationProperties()

### determineWkbCapacity

protected int determineWkbCapacity​(boolean excludeZMFromWKB)

### appendToWKTBuffers

protected void appendToWKTBuffers​(java.lang.Object o)
Append the data to both stringbuffers.

Parameters:
  `o` - data to append to the stringbuffers.

### interpretSerializationPropBytes

protected void interpretSerializationPropBytes()

### readNumberOfPoints

protected void readNumberOfPoints() throws SQLServerException

Throws:
  `SQLServerException`

### readZvalues

protected void readZvalues() throws SQLServerException

Throws:
  `SQLServerException`

### readMvalues

protected void readMvalues() throws SQLServerException

Throws:
  `SQLServerException`

### readNumberOfFigures

protected void readNumberOfFigures() throws SQLServerException

Throws:
  `SQLServerException`

### readFigures

protected void readFigures() throws SQLServerException

Throws:
  `SQLServerException`

### readNumberOfShapes

protected void readNumberOfShapes() throws SQLServerException

Throws:
  `SQLServerException`

### readShapes

protected void readShapes() throws SQLServerException

Throws:
  `SQLServerException`

### readNumberOfSegments

protected void readNumberOfSegments() throws SQLServerException

Throws:
  `SQLServerException`

### readSegments

protected void readSegments() throws SQLServerException

Throws:
  `SQLServerException`

### determineInternalType

protected void determineInternalType()

### checkEmptyKeyword

protected boolean checkEmptyKeyword​(int parentShapeIndex, InternalSpatialDatatype isd, boolean isInsideAnotherShape) throws SQLServerException

Throws:
  `SQLServerException`

### throwIllegalWKT

protected void throwIllegalWKT() throws SQLServerException

Throws:
  `SQLServerException`

### throwIllegalWKB

protected void throwIllegalWKB() throws SQLServerException

Throws:
  `SQLServerException`

### readByte

protected byte readByte() throws SQLServerException

Throws:
  `SQLServerException`

### readInt

protected int readInt() throws SQLServerException

Throws:
  `SQLServerException`

### readDouble

protected double readDouble() throws SQLServerException

Throws:
  `SQLServerException`

### getPointList

public java.util.List<Point> getPointList()

### getFigureList

public java.util.List<Figure> getFigureList()

### getShapeList

public java.util.List<Shape> getShapeList()

### getSegmentList

public java.util.List<Segment> getSegmentList()