[udig-devel] Problem with FeatureCollection, FeatureTableControl and CollectionListener

Ingmar Eveslage eveslage at gmail.com
Thu Feb 14 17:03:25 PST 2008


Am 15.02.2008 um 01:46 schrieb Jody Garnett:

> Ingmar Eveslage wrote:
>> All seams fine, but i notices a few problems:
>>
>> 1) the automatic created column header for the AttributeType point is
>> "GEOMETRY". but i defined it as "Location". The first thing is a
>> nullPointerException if the FeatureTableControl wants to display a  
>> feature.
>> When i change the name of my attributetype to "GEOMETRY" all is  
>> fine. But i
>> think this is a bug.
>>
> Interesting - that comes down to the data store used behind this  
> method:
> -  
> CatalogPlugin 
> .getDefault 
> ().getLocalCatalog().createTemporaryResource(stationFeatureType);
>
> In general you should *not* trust the feature type to appear exactly  
> as you asked for; different data store implementations have  
> different abilities. Please grab the featureType from the created  
> data store. One fork of GeoTools made use a of a seperate  
> FeatureDefinition class for this purpose; to make what was going on  
> more clear. That said we are making use of MemoryDataStore as far as  
> I know and it should not force you to use GEOMETRY.
thats fair. now i know, why the name changed. this isnt so bad.

>> 2) if i add features to the layer, no updates in the table will be
>> displayed.
> How are you adding the features: FeatureStore.addFeatures( ... ) -  
> and if so you using a Transaction?
i add feature by "clicking" on the layer in the editor window. and the  
add-tool uses transactions.

>> and i do not realy know which listener i should take. i tried the  
>> following:
>> every implementation of the changed method makes a tfc.update.
>>
>> stationFeatureSource.addFeatureListener(view_i_created);
>> 	--> all updates are listed in the table, but the commit of the  
>> station
>> layer makes no update. so all the FID are still "new*" and not the  
>> real one
>> features.addListener(view_i_created);
>>
> That sounds like a bug; note that you should be on a Transaction for  
> this stuff and get a single "stuff changed" event out when the
> transaction is committed.
i hoped so.

>> 	--> nothing happens. no CollectionEvent fired
>>
>> i looked in the FeatureTableControl implementation and i think this
>> implementation uses the CollectionListener interface too. but when no
>> CollectionEvents are fired, no updates are displayed.
>>
> Okay sounds like a raft of bugs to report to the GeoTools project  
> here...
>> i hope someone can help me with my 2 problem. perhaps this are bugs  
>> or do i missunderstand the api?
>>
> Your understanding is fine; GeoTools is used a lot by server  
> applications (cough GeoServer) and client applications like uDig are  
> the only people who care about events...
> Jody

what should i do now? can i change the version of geotools in udig?  
perhaps make usage of version 2.4 or so? but i think this isnt easy or  
perhaps impossible.

i dont realy "know" the geotools community. where should i post such a  
bug-report? geotools-gt2-users or geotools-devel?


More information about the udig-devel mailing list