I see your point. Whether (and how) to override the equals method is always very difficult to decide, I find. But I must say that I think the wrapped feature and the wrappee should be considered "logically equal". I realize this would be a very fundamental change, and so requires thorough discussion, but this is my feeling anyway.
Erik Justin Deoliveira wrote: > Hi Erik, > > You raise a very good point here. But the issue is complex as equals for > feature has never really been defined. If a feature was always the > reflection of a "record" in storage (i am using a shapefile or database > anlogy here), then the straight ID comparison would probably work. > However... often we "wrap" features up for various purposes. Examples > being reprojecting to a particular coordinate system, filtering the > number of attributes creating a view like object, etc... > > In all teh cases the "Wrapper" maintains the original id, but would we > call a wrapped feature and wrappee "equal"... tough to say. > > What do others think about this? > > -Justin > > Erik Løvlie wrote: > >> Hello everyone, I have a question: >> >> Why does the DefaultFeature equals method only accept features where all >> attribute values are equal to the corresponding attribute in the feature >> called on? Seems very strict to me, why not accept all features of the >> same type and with the same ID? >> >> This behavior is causing some problems for us. First because it is quite >> slow, and second because use of the JTS Quadtree becomes complicated >> (cannot remove a feature in the quadtree using a different feature >> instance with the same type and id but possibly with different (null) >> attributes). >> >> Regards, >> Erik Loevlie >> >> ------------------------------------------------------------------------- >> SF.Net email is sponsored by: >> Check out the new SourceForge.net Marketplace. >> It's the best place to buy or sell services for >> just about anything Open Source. >> http://sourceforge.net/services/buy/index.php >> _______________________________________________ >> Geotools-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/geotools-devel >> >> !DSPAM:4007,475d32f1253741804284693! >> >> > > > ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
