02.05.2014 Views

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - Ocean - Schlumberger

Ocean* Application Development Framework - 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 />

A converter is created using the coordinate service based on the source and target<br />

coordinate systems you specify or just one coordinate system if you are converting<br />

between spherical and projected coordinates.<br />

ICoordinateService cs = CoreSystem.GetService();<br />

Point3 pt = ...;<br />

// the source and target coordinate systems<br />

ICoordinateReferenceSystem csSource;<br />

ICoordinateReferenceSystem csTarget;<br />

csSource = cs.GetCoordSys("MENTOR: UTM84-11N");<br />

csTarget = cs.GetCoordSys("MENTOR: UTM84-12N");<br />

// Create a converter between two coordinate reference systems.<br />

ICoordinateOperation Converter;<br />

ReturnStatus status = cs.CreateOperation( csSource,<br />

csTarget,<br />

PrePostUnitConversions.None,<br />

out Converter);<br />

// Make sure converter created and convert a point.<br />

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

{<br />

CoreLogger.Error(“Error creating coordinate converter.”);<br />

return;<br />

}<br />

// Create a converter to go from spherical to projected.<br />

ICoordinateOperation SphereToProject;<br />

status = cs.CreateOperationFromReference(csSource<br />

PrePostUnitConvertion.None,<br />

out SphereToProject);<br />

// Make sure converter created and convert a point.<br />

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

{<br />

CoreLogger.Error(“Error creating spherical “ +<br />

“to projected converter.”);<br />

}<br />

Once you have an ICoordinateOperation, you can convert Point3 references<br />

using any of its overloaded Convert methods:<br />

ReturnStatus Convert( ref Point3 );<br />

ReturnStatus Convert( ref Point3[] );<br />

You should notice from the method signatures above that all of the Convert<br />

methods return a ReturnStatus to indicate success or error/warning conditions.<br />

Please see “Return Status” on page 4-188 for more details.<br />

<strong>Schlumberger</strong> Private - Customer Use<br />

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

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

Saved successfully!

Ooh no, something went wrong!