<< Click to Display Table of Contents >> Navigation: Technical Guide > Geometry > Corrections |
DTSGeoJson corrections are encoded as an array of Line Solutions, each of which describes a sector's exact representation and its place within the geometry structure's coordinates. A Line Solution must represent a continuous curve.
This is the structure of a Line Solution:
{
"startIndex": 0,
"length": 0,
"exactRepresentation": [],
"lineType": ""
}
startIndex |
Represents the total index of the geometry structure's coordinates where the corrected sector starts. The total index represents the index across sub-arrays down to coordinate level. |
length |
Represents the length of the approximation in the geometry structure's coordinates that this correction replaces. |
exactRepresentation |
an array of double[], each of which represents a coordinate. Each double[] must contain the same number of double values (ordinates), which can only be 2 or 3, however certain 3D corrections are not supported at this time (see Known Limitations). These coordinates will be interpreted and translated to datasource-specific geometry encodings according to the lineType. |
lineType |
Represents the type of curve this representation encodes. Possible values are: |
Value |
Interpretation |
LINE_STRING |
The coordinates represent a series of straight line segments, as they would in the geometry structure's coordinates. This correction type is redundant, but exists for specialized clients which can pass exact geometry representations using only the corrections field. |
CP_ARCS |
The coordinates represent a series of Center Point Circle Arcs. Each arc is encoded by 3 coordinates [start, middle, end]. The middle coordinate can be any point on the arc. In geometries created by DTS, the middle coordinate is always the exact middle of the arc. The end coordinate of an arc also serves as the start coordinate of the next arc, so the total number of coordinates will be 2*N_ARCS+1. Please note that elliptical / tangent arcs cannot be encoded with this lineType and need to be defined as NURBS.
|
NURBS |
The coordinates represent a Non-Uniform Rational B-Spline as follows: [ [ D, N, K ], [ knot1, ..., knotK ], [ contolPoint1 ], ..., [ controlPointN ] ] Where: D: the degree of the NURBS N: the number of control points K: the number of knots knot1, ..., knotK: the knots (K double values) [controlPoint1], ..., [controlPointN]: the weighted control points (N arrays of double values containing the coordinate for the respective control point and the weight [x, y, z, w]) A correctly defined NURBS will agree with K = D + N + 1
|
RECTANGLE |
The coordinates represent the opposite corners of a rectangle. Serves as shorthand for the equivalent polygon which would use 5 coordinates instead of 2. |
CIRCLE |
The coordinates represent a circle using 2 coordinates: [ [centerCoord], [anyOtherPointOnCircle] ] |
When feeding geometry data to a system via DTS using DTSGeoJson, it is possible to set exact representations in the corrections field and not calculate any approximations for the coordinates field. For this to work, the targeted connector must be capable of using the DTSGeoJson extensions and the coordinates field must contain some minimal placeholder values that will be replaced by the exact corrections upon processing.