public class Geometry extends Object
Modifier and Type | Field | Description |
---|---|---|
protected 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 List<com.microsoft.sqlserver.jdbc.Figure> |
figureList |
|
protected com.microsoft.sqlserver.jdbc.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 List<com.microsoft.sqlserver.jdbc.Point> |
pointList |
|
protected double[] |
points |
|
protected List<com.microsoft.sqlserver.jdbc.Segment> |
segmentList |
|
protected com.microsoft.sqlserver.jdbc.Segment[] |
segments |
|
protected byte |
serializationProperties |
|
protected List<com.microsoft.sqlserver.jdbc.Shape> |
shapeList |
|
protected com.microsoft.sqlserver.jdbc.Shape[] |
shapes |
|
protected int |
srid |
|
protected byte |
version |
|
protected byte[] |
wkb |
|
protected byte[] |
wkbNoZM |
|
protected String |
wkt |
|
protected String |
wktNoZM |
|
protected StringBuffer |
WKTsb |
|
protected StringBuffer |
WKTsbNoZM |
|
protected double[] |
zValues |
Constructor | Description |
---|---|
Geometry() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
appendToWKTBuffers(Object o) |
Append the data to both stringbuffers.
|
String |
asTextZM() |
|
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) |
Create the WKT representation of Geometry/Geography from the deserialized data.
|
protected void |
createSerializationProperties() |
|
static Geometry |
deserialize(byte[] wkb) |
Returns a constructed Geometry from an internal SQL Server format for spatial data.
|
protected void |
determineInternalType() |
|
protected int |
determineWkbCapacity() |
|
Double |
getM() |
|
protected String |
getNextStringToken() |
Reads the next string token (usually POINT, LINESTRING, etc.).
|
int |
getSrid() |
|
Double |
getX() |
|
Double |
getY() |
|
Double |
getZ() |
|
boolean |
hasM() |
|
protected boolean |
hasMoreToken() |
|
boolean |
hasZ() |
|
protected void |
interpretSerializationPropBytes() |
|
boolean |
isNull() |
|
static Geometry |
parse(String wkt) |
Returns a Geometry instance from an Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation.
|
protected void |
parseWkb() |
Deserialize 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 Geometry |
point(double x,
double y,
int srid) |
Constructs a Geometry instance that represents a Point instance from its X and Y values and an SRID.
|
protected void |
populateStructures() |
Populates the various data structures contained within the Geometry/Geography instace.
|
protected void |
readCloseBracket() |
|
protected void |
readCompoundCurveWkt(boolean isFirstIteration) |
Reads a CompoundCurve WKT
|
protected void |
readCurvePolygon() |
Reads a CurvePolygon WKT
|
protected void |
readFigures() |
|
protected void |
readLineWkt() |
Reads a series of Point types.
|
protected void |
readMultiPolygonWkt(int thisShapeIndex,
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,
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 Geometry type.
|
protected void |
serializeToWkb(boolean noZM) |
Serializes the Geogemetry/Geography instance to WKB.
|
byte[] |
STAsBinary() |
Returns the Open Geospatial Consortium (OGC) Well-Known Binary (WKB) representation of a
Geometry instance.
|
String |
STAsText() |
Returns the Open Geospatial Consortium (OGC) Well-Known Text (WKT) representation of a
Geometry instance.
|
String |
STGeometryType() |
Returns the Open Geospatial Consortium (OGC) type name represented by a geometry instance.
|
static Geometry |
STGeomFromText(String wkt,
int srid) |
Returns a Geometry 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 Geometry |
STGeomFromWKB(byte[] wkb) |
Returns a Geometry instance from an Open Geospatial Consortium (OGC)
Well-Known Binary (WKB) representation.
|
int |
STNumPoints() |
|
String |
toString() |
protected ByteBuffer buffer
protected InternalSpatialDatatype internalType
protected String wkt
protected String wktNoZM
protected byte[] wkb
protected byte[] wkbNoZM
protected int srid
protected byte version
protected int numberOfPoints
protected int numberOfFigures
protected int numberOfShapes
protected int numberOfSegments
protected StringBuffer WKTsb
protected StringBuffer WKTsbNoZM
protected int currentPointIndex
protected int currentFigureIndex
protected int currentSegmentIndex
protected int currentShapeIndex
protected double[] points
protected double[] zValues
protected double[] mValues
protected com.microsoft.sqlserver.jdbc.Figure[] figures
protected com.microsoft.sqlserver.jdbc.Shape[] shapes
protected com.microsoft.sqlserver.jdbc.Segment[] segments
protected boolean hasZvalues
protected boolean hasMvalues
protected boolean isValid
protected boolean isSinglePoint
protected boolean isSingleLineSegment
protected boolean isLargerThanHemisphere
protected boolean isNull
protected final byte FA_INTERIOR_RING
protected final byte FA_STROKE
protected final byte FA_EXTERIOR_RING
protected final byte FA_POINT
protected final byte FA_LINE
protected final byte FA_ARC
protected final byte FA_COMPOSITE_CURVE
protected int currentWktPos
protected List<com.microsoft.sqlserver.jdbc.Point> pointList
protected List<com.microsoft.sqlserver.jdbc.Figure> figureList
protected List<com.microsoft.sqlserver.jdbc.Shape> shapeList
protected List<com.microsoft.sqlserver.jdbc.Segment> segmentList
protected byte serializationProperties
public static Geometry STGeomFromText(String wkt, int srid)
wkt
- WKTsrid
- SRIDpublic static Geometry STGeomFromWKB(byte[] wkb)
wkb
- WKBpublic static Geometry deserialize(byte[] wkb)
wkb
- WKBpublic static Geometry parse(String wkt)
wkt
- WKTpublic static Geometry point(double x, double y, int srid)
x
- x coordinatey
- y coordinatesrid
- SRIDpublic String STAsText()
public byte[] STAsBinary()
public byte[] serialize()
public boolean hasM()
public boolean hasZ()
public Double getX()
public Double getY()
public Double getM()
public Double getZ()
public int getSrid()
public boolean isNull()
public int STNumPoints()
public String STGeometryType()
public String asTextZM()
protected void serializeToWkb(boolean noZM)
noZM
- flag to indicate if Z and M coordinates should be includedprotected void parseWkb()
protected void constructWKT(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, InternalSpatialDatatype isd, int pointIndexEnd, int figureIndexEnd, int segmentIndexEnd, int shapeIndexEnd)
sd
- the Geometry/Geography instance.isd
- internal spatial datatype objectpointIndexEnd
- upper bound for reading pointsfigureIndexEnd
- upper bound for reading figuressegmentIndexEnd
- upper bound for reading segmentsshapeIndexEnd
- upper bound for reading shapesprotected void parseWKTForSerialization(com.microsoft.sqlserver.jdbc.SQLServerSpatialDatatype sd, int startPos, int parentShapeIndex, boolean isGeoCollection)
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.protected void constructPointWKT(int pointIndex)
pointIndex
- indicates which point to append to the stringbuffer.protected void constructLineWKT(int pointStartIndex, int pointEndIndex)
pointStartIndex
- .pointEndIndex
- .protected void constructShapeWKT(int figureStartIndex, int figureEndIndex)
figureStartIndex
- .figureEndIndex
- .protected void constructMultiShapeWKT(int shapeStartIndex, int shapeEndIndex)
shapeStartIndex
- .shapeEndIndex
- .protected void constructCompoundcurveWKT(int segmentStartIndex, int segmentEndIndex, int pointEndIndex)
segmentStartIndex
- .segmentEndIndex
- .pointEndIndex
- .protected void constructMultipolygonWKT(int shapeStartIndex, int shapeEndIndex)
shapeStartIndex
- .shapeEndIndex
- .protected void constructCurvepolygonWKT(int figureStartIndex, int figureEndIndex, int segmentStartIndex, int segmentEndIndex)
figureStartIndex
- .figureEndIndex
- .segmentStartIndex
- .segmentEndIndex
- .protected void constructSegmentWKT(int currentSegment, byte segment, int pointEndIndex)
currentSegment
- .segment
- .pointEndIndex
- .protected void constructGeometryCollectionWKT(int shapeEndIndex)
shapeEndIndex
- .protected void readPointWkt()
protected void readLineWkt()
protected void readShapeWkt(int parentShapeIndex, String nextToken)
parentShapeIndex
- shape index of the parent shape that called this methodnextToken
- next string tokenprotected void readCurvePolygon()
protected void readMultiPolygonWkt(int thisShapeIndex, String nextToken)
thisShapeIndex
- shape index of current shapenextToken
- next string tokenprotected void readSegmentWkt(int segmentType, boolean isFirstIteration)
segmentType
- segment typeisFirstIteration
- flag that indicates if this is the first iteration from the loop outsideprotected void readCompoundCurveWkt(boolean isFirstIteration)
isFirstIteration
- flag that indicates if this is the first iteration from the loop outsideprotected String getNextStringToken()
protected void populateStructures()
protected void readOpenBracket()
protected void readCloseBracket()
protected boolean hasMoreToken()
protected void createSerializationProperties()
protected int determineWkbCapacity()
protected void appendToWKTBuffers(Object o)
o
- data to append to the stringbuffers.protected void interpretSerializationPropBytes()
protected void readNumberOfPoints()
protected void readZvalues()
protected void readMvalues()
protected void readNumberOfFigures()
protected void readFigures()
protected void readNumberOfShapes()
protected void readShapes()
protected void readNumberOfSegments()
protected void readSegments()
protected void determineInternalType()
protected boolean checkEmptyKeyword(int parentShapeIndex, InternalSpatialDatatype isd, boolean isInsideAnotherShape)
Copyright © 2018 Microsoft Corporation. All rights reserved.