yes... you have to copy every feature to the new schema. There is an 
class and method in the api package (taken from pirol) that does copy 
from an old to a new schema. (It could be that the examples on the wiki 
provide code for that too. But I think I also answered an email on that 
issues just a while ago on one of the lists)

I think this was designed that way for some safety reasons.

stefan

Larry Becker wrote:
> Sounds like normal behavior to me.
> 
> Larry
> 
> On Mon, Jan 12, 2009 at 3:13 PM, Sunburned Surveyor 
> <sunburned.surve...@gmail.com <mailto:sunburned.surve...@gmail.com>> wrote:
> 
>     I'm in the midst of writing the unit tests for my plugin that adds
>     attributes to all the Feature objects in a layer using information
>     stored in a CSV file.
> 
>     I'm having some trouble adding an attribute to all of the Feature
>     objects in a Feature Collection. I can sucessfully modify the
>     FeatureSchema for the FeatureCollection and all of the Feature objects
>     it contains, but this isn't modifying the internal array used to store
>     the feature attribute values in each Feature object. I checked the
>     Feature interface, and it doesn't have an addAttribute method.
> 
>     This means my modifications of the FeatureSchema for the Feature
>     aren't modifying the underlying number of attributes in the Feature
>     implementation. So even though the FeatureSchema object I get from the
>     Feature object reflects my addition, the actual Feature object itself
>     does not. This seems like odd behavior and I'm surprised I haven't
>     noticed it before.
> 
>     So do I have to create a copy of each Feature object in the
>     FeatureCollection using the new schema and over write the existing
>     Feature objects to implement my change, or is there an easier way?
> 
>     On a related note, would it be handy to have a Feature implementation
>     that changed its internal state when its FeatureSchema reference was
>     changed?
> 
>     Maybe I am missing something obvious.
> 
>     Thanks for any suggestions.
> 
>     The Sunburned Surveyor
> 
>     
> ------------------------------------------------------------------------------
>     This SF.net email is sponsored by:
>     SourcForge Community
>     SourceForge wants to tell your story.
>     http://p.sf.net/sfu/sf-spreadtheword
>     _______________________________________________
>     Jump-pilot-devel mailing list
>     Jump-pilot-devel@lists.sourceforge.net
>     <mailto:Jump-pilot-devel@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 
> 
> 
> 
> -- 
> http://amusingprogrammer.blogspot.com/
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to