I have to admit that I did not think about the hash thing therefore I agree on having two separate methods for strict equals.
Talking about the other method (equals + EPS) don't you think that the method I proposed might be more general? Weighting the difference with the length on the inspected axes. It is very difficult in general to use a direct method as you implemented. As an instance if you have high res photographs ( I have some at 5 cm) eps can vary too much with respect to other sources at lower res. Taking into account length should help with these cases. What do you think? Simone. On 3/6/06, Martin Desruisseaux <[EMAIL PROTECTED]> wrote: > Simone Giannecchini a écrit : > > Ok Martin I got a couple of improvments for tiling but now I have a > > suggestion for improving the equals method on general envelope. What > > do you think about this one? > > We can't really let GeneralEnvelope.equals(Object) compares coordinate values > with a hard-coded EPS > tolerance value, because it would break that java.util.Map contract. We could > have: > > a.equals(b) with a.hashCode() != b.hashCode() > > I believe that GeneralEnvelope.equals(Object) should really be strict, > otherwise we are opening the > door to unexpected side effects. However, we can very well provide a > GeneralEnvelope.equals(Envelope, double eps) method. Actually, such a method > has already been added > to trunk. See: > > http://svn.geotools.org/geotools/trunk/gt/module/referencing/src/org/geotools/geometry/GeneralEnvelope.java > > scroll down to the bottom of the page. Note that if we need to change the > implementation for > whatever reason, we can still do that since this method is not part of 2.2 > release. > > Martin. > -- °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° Simone Giannecchini Software Engineer Freelance Consultant http://simboss.wordpress.com/ °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel