Martin Desruisseaux wrote:

>>What is DoubleOperation? What are its advantage compared to the usual '-'
>>operator? position.getOrdinate(i) returns double value anyway, and
>>Math.abs(double) expect a double anyway.
>>
>>Additional note: I suggest to replace:
>>
>> if (abs(position.getOrdinate(i) - this.getOrdinate(i)) > tol)
>>
>>by
>>
>> if (!(abs(position.getOrdinate(i) - this.getOrdinate(i))) <= tol)
>>
>>Purpose: consider positions as different if at least one ordinate is 
>>Double.NaN.
>>
>>      Martin
>> 
>>
>>    
>>
I think that we should consider positions with similar NaN ordinates to 
be equal.  Currently you can create a DirectPosition without 
initializing ordinates, and they will be filled with Double.NaN.  If you 
then compare these positions, or enter values for only 1 of 2 ordinates 
(or only 2of 3, etc), these positions would not be considered equal if 
we change this.  This might be especially important for 2.5 Dimension 
positions.

Consider this example, you have two points in 2.5 Dimensions (x, y and 
some non-spatial value to be stored in z).  If you create the positions 
with the same x and y values, but do not have a value to enter for the z 
dimension yet, should these positions not be considered equal at this 
point?  The z ordinates will be NaN.

So, I think I should leave this last part of the DirectPosition equals 
method the same.  What do you think?

-- 
Graham Davis
Refractions Research Inc.
[EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to