Question

What is the difference between the index in Ocean environment and index in User environment? Why should one use Convert Index To/From UI?

Was it helpful?

Solution

Let's assume in this case that we have a grid that is oriented such that I increments from south to north and J increments from west to east. So the upper right cartesian coordinate space. By convention when you access a pillar grid in Ocean via an Index3 the minimum index possible (0,0) will be at the lower left corner of this grid. In this case the UI index for the grid and the Ocean index for the grid align.

Now, if you had another grid where the I axis incremented from north to south (J axis the same) the lower left corner of this grid would be I maximum, J 0. However, Ocean would return this index as (0, 0) still.

Ocean has a convention that the origin of the grid (0, 0) is at the lower left corner.

Ocean provides the methods you mention ConvertIndexToUI and ConvertIndexFromUI to convert from how the user has described the grid, as I mention above, to the Ocean convention. This means that if you are performing some operation where the indexing matters you should first call the appropriate conversion method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top