Last updated

API / geotoolkit / deviation / Trajectory2d / Trajectory2d

Class: Trajectory2d

deviation.Trajectory2d.Trajectory2d

Class Trajectory2d is used to define trajectory and it provides coordinates of each point along the planned well path. Trajectory contains MD- (measured depth), X- and Y-coordinates along itself.
If measured depth is not provided it is calculated from 0 along the path.

Hierarchy

Table of contents

Constructors
[new Trajectory2d(options)](/solutions/geotoolkit/apis/classes/geotoolkit.deviation.trajectory2d.trajectory2d.md#new trajectory2d(options))[new Trajectory2d(x, y, d)](/solutions/geotoolkit/apis/classes/geotoolkit.deviation.trajectory2d.trajectory2d.md#new trajectory2d(x, y, d))
Methods

Contents

Constructors

new Trajectory2d(options)

new Trajectory2d(options?)

Creates a new instance of Trajectory2d class

Parameters

Name Type Description
Optional optionsOptionsobject containing data and options

Overrides

EventDispatcher.constructor


new Trajectory2d(x, y, d)

new Trajectory2d(x?, y?, d?)

Creates a new instance of Trajectory2d class

Parameters

Name Type Description
Optional xnumber[]x-coordinate of the transformed stations
Optional ynumber[]y-coordinate of the transformed stations
Optional dnumber[]d-measured depths array for each station

Overrides

EventDispatcher.constructor

Methods

add

add(x, y, md?): Trajectory2d

Adds new trajectory station to the end of trajectory

Parameters

Name Type Description
xnumberthe transformed station x-coordinate
ynumberthe transformed station y-coordinate
Optional mdnumberthe transformed station measured depth

Returns

Trajectory2d

add(x, y, md?): Trajectory2d

Adds a trajectory stations array to the end of trajectory

Parameters

Name Type Description
xnumber[]the transformed station x-coordinate array
ynumber[]the transformed station y-coordinate array
Optional mdnumber[]the transformed station measured depth array

Returns

Trajectory2d


clear

clear(): Trajectory2d

Removes all the trajectory stations

Returns

Trajectory2d


count

count(): number

Gets number of stations in the trajectory

Returns

number

number of stations


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


equals

equals(trajectory): boolean

Checks for trajectories equality

Parameters

Name Type Description
trajectoryTrajectory2dother trajectory

Returns

boolean


getArrayX

getArrayX(): number[]

Gets x-values array

Returns

number[]


getArrayY

getArrayY(): number[]

Gets y-values array

Returns

number[]


getClassName

getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getDepth

getDepth(index): number

Gets MD-value at specified position

Parameters

Name Type Description
indexnumberindex of the station

Returns

number

value if found; "undefined" otherwise


getDepths

getDepths(): number[]

Gets MD-values array

Returns

number[]


getMaxX

getMaxX(): number

Gets calculated maximal x-value (convenience method)

Returns

number


getMaxY

getMaxY(): number

Gets calculated maximal y-value (convenience method)

Returns

number


getMinX

getMinX(): number

Gets calculated minimal x-value (convenience method)

Returns

number


getMinY

getMinY(): number

Gets calculated minimal y-value (convenience method)

Returns

number


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties


getX

getX(index): number

Gets x-value at specified position

Parameters

Name Type Description
indexnumberindex of the station

Returns

number

value if found; "undefined" otherwise


getY

getY(index): number

Gets y-value at specified position

Parameters

Name Type Description
indexnumberindex of the station

Returns

number

value if found; "undefined" otherwise


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


interpolateXY

interpolateXY(md, pt?): Point

Interpolates (x;y)-point at MD-value

Parameters

Name Type Description
mdnumberMD-value
Optional ptPointpoint to put (x;y) in

Returns

Point

interpolated point; or null if trajectory too short


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


maxDepth

maxDepth(): number

Gets calculated maximal MD

Returns

number

maximal MD


minDepth

minDepth(): number

Gets calculated minimal MD

Returns

number

minimal MD


notify

notify<E>(type, source, args?): Trajectory2d

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceTrajectory2dof the event
Optional argsEventMap[E]arguments of the event

Returns

Trajectory2d

this

Overrides

EventDispatcher.notify


off

off<E>(type?, callback?): Trajectory2d

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: Trajectory2d, args: EventMap[E]) => voidfunction to be called

Returns

Trajectory2d

this

Overrides

EventDispatcher.off


on

on<E>(type, callback): Trajectory2d

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: Trajectory2d, args: EventMap[E]) => voidto be called

Returns

Trajectory2d

this

Overrides

EventDispatcher.on


onDataChanged

Protected onDataChanged(): void

Fires the Events~DataChanged event

Returns

void


setProperties

setProperties(props?): Trajectory2d

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propsOptionsproperties

Returns

Trajectory2d

this


setSilent

setSilent(bool): Trajectory2d

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Trajectory2d

this

Inherited from

EventDispatcher.setSilent


shift

shift(count): Trajectory2d

Removes first count stations from a trajectory

Parameters

Name Type Description
countnumberan integer indicating the number of stations to remove. If count is greater than or equal to the number of stations, then all the stations will be deleted. If count is 0 or negative, no stations are removed.

Returns

Trajectory2d


createTrajectory

Static createTrajectory(arg, inclination?, azimuth?, rightDeviation?, start?, filter?, approximate?): Trajectory2d

Creates trajectory from arrays of measured depths,inclinations and azimuths.

Parameters

Name Type Description
argnumber[] | CreateTrajectoryArgan array of the measured depth or object containing data and options
Optional inclinationnumber[]an array of the inclinations
Optional azimuthnumber[]an array of azimuths. (not used now)
Optional rightDeviationbooleanrightDeviation means trjajectory goes from north-west to south-east with positive inclination angle
Optional startnumberstart index
Optional filterbooleanif true, perform filtering of redundant points. Removes any points, which could be removed safely, keeping the trajectory geometry and measured depth binding:
1. If two points have the same coordinates, it keeps the second point only
2. If two points have the same MD value, it keeps the second point only
3. If three points belong to a same line in a natural order (i.e. second point positioned between 1st and 3rd),
and MD value of middle point corresponds to the point position, it removes the middle point
NOTE: The rules are applied recursively
Optional approximatebooleanflag set to enable approximation of the trajectory along the path

Returns

Trajectory2d

trajectory


fromObject

Static fromObject(object?): Trajectory2d

Creates or gets Trajectory2d instance from object

Parameters

Name Type Description
Optional objectTrajectory2d | { id?: string ; md: number[] ; x: number[] ; y: number[] }object can be in format of constructor

Returns

Trajectory2d


getClassName

Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName