Thanks for the input. I've currently got the equals method working so that that the CRS constrains the test to the number of dimensions it defines. Both equals methods use this (object) and (position). They both also test specifically for Double.NaN so that anytime similar ordinates are NaN they are considered equal. For now I think having both methods work similarly is the most intuitive. If it turns out we need to change one or both so that 2.5D comparisons do look at the 3rd ordinate, we can change it at that time.
Graham. Jody Garnett wrote: > This is a tough call .. one way to handle it would be in the 2.5 D > case use the CRS should constrain the equals test to only the first 2 > dimensions (and ignore the 3rd ordinate regardless of what kind of > value it is?). > > I think Martin has the right idea here (for the DirectPosition.equals( > Object ) method), their may be a use for a DirectPosition.equals( > Position ) method which performs the CRS aware comparison.... > > You are in a better position to appreciate the difference than me ... > it is the same tradeoff between Geometry.equals( Object ) and > Geometry.equals( TransfiniteSet ). > > Cheers, > Jody > > Graham Davis wrote: > >> 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
