Hi developers,
I'm getting unexpected behaviour from FeatureCollection.
Basically, what I'm doing is this:
final FeatureCollection featuresBeforeInsert =
getAllFeatures(connectionString, typeName);
insertFeature(connectionString, typeName, featureAttributes);
final FeatureCollection featuresAfterInsert =
getAllFeatures(connectionString, typeName);
assertEquals(featuresBeforeInsert.size(), featuresAfterInsert.size()-1);
where getAllFeatures() retrieves all features of the given type from the
PostGIS data store, and insertFeature inserts one feature of the given
type with the given attributes in the data store.
The assert fails, because both collections featuresBeforeInsert and
featuresAfterInsert have the same size. Apparently, the insertFeature
also changes the collection under the hood of the featuresBeforeInsert...
That is rather unexpected. Is this intended behaviour? Should I have
been aware of it? Is it documented somewhere? And more importantly:
how do I get a FeatureCollection that does not get changed underneath me?
Regards,
--
-- Gertjan van Oosten, [EMAIL PROTECTED], West Consulting B.V., +31 15 2191 600
-------------------------------------------------------------------------
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