02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Coordinate Systems<br />

These methods provide an alternative to checking thrown exceptions or having API<br />

methods return cryptic error codes that must be parsed. For a more detailed description of<br />

any error or warning encountered, you should get the values of the Message and Code<br />

properties. The following code sample shows an example of using the ReturnStatus<br />

object.<br />

// Assume csConverter and origPoint have been successfully created<br />

// The status object will be instantiated by converter engine<br />

ReturnStatus status = null;<br />

// Status object is most often passed as an output parameter<br />

Point3 newPoint = csConverter.Convert(origPoint, out status);<br />

// Ceck status object with simple boolean method<br />

if (status.IsOk())<br />

{<br />

Console.WriteLine("Conversion went okay!");<br />

}<br />

else if (status.IsError())<br />

{<br />

Console.WriteLine("Error during coordinate conversion process.");<br />

Console.WriteLine("Error Code {0}, Message {1}", status.Code,<br />

status.Message);<br />

}<br />

else if (status.IsWarning())<br />

{<br />

// write to error log file<br />

}<br />

As mentioned in the above example, the status object is often referenced as an output<br />

parameter.<br />

Local Transforms<br />

Local Transforms are used to convert coordinates between a projected coordinate system<br />

and an applications system. This allows you to convert, for example, from X, Y, Z to line,<br />

crossline, and depth. You can also perform shifting of points within one coordinate system.<br />

The conversion is accomplished by introducing a Matrix4 object. The LocalTransform<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Services 4-221

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!