02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Coordinate Systems<br />

A converter is created based on the source and target coordinate systems you specify or<br />

just one coordinate system if you are converting between spherical and projected<br />

coordinates.<br />

// Get the needed coordinate systems.<br />

ICoordSys cs = csService.GetCoordSys(“MENTOR:UTM84-31N”);<br />

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

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

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

// Create a coordinate system converter between two<br />

// coordinate systems.<br />

ICoordSysConverter csConverter = cs.CreateConverter(csSource,<br />

csTarget);<br />

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

ICoordSysConverter sphereToProject;<br />

sphereToProject = cs.CreateConverterFromReference(csSource);<br />

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

ICoordSysConverter projectToSphere;<br />

projectToSphere = cs.CreateConverterToReference csSource);<br />

Once you have a converter reference, you can convert Point3 references using any of<br />

the following overloaded Convert methods:<br />

public Point3 Convert(Point3, out ReturnStatus);<br />

public Point3 [] Convert(Point3[], out ReturnStatus);<br />

public void Convert(ref Point3, out ReturnStatus);<br />

public void Convert(ref Point3 [], out ReturnStatus);<br />

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

a ReturnStatus output parameter to indicate success or error/warning conditions.<br />

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

4-218 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!