[udig-devel] change new feature

Jesse Eichar jeichar at refractions.net
Mon Nov 5 10:47:54 PST 2007


I'm on it.

Jesse

On 5-Nov-07, at 10:32 AM, Piebe de Vries wrote:

> Since nobody reacted, I just give my own answer:
>
> The bug can be found in AddFeatureCommand.getNewFeature
> If I understand this method rightly, it should return the latest new  
> feature. I put in some system.out messages and as you can see it  
> will return the first new feature and not the latest:
>
> looking for fid = newbsbb:redlining_effectzones.9223372036854775798  
> in:
> fid = newbsbb:redlining_effectzones.9223372036854775807
> fid = newbsbb:redlining_effectzones.9223372036854775806
> fid = newbsbb:redlining_effectzones.9223372036854775805
> fid = newbsbb:redlining_effectzones.9223372036854775804
> fid = newbsbb:redlining_effectzones.9223372036854775803
> fid = newbsbb:redlining_effectzones.9223372036854775802
> fid = newbsbb:redlining_effectzones.9223372036854775801
> fid = newbsbb:redlining_effectzones.9223372036854775800
> fid = newbsbb:redlining_effectzones.9223372036854775799
> fid = newbsbb:redlining_effectzones.9223372036854775798
> returning = newbsbb:redlining_effectzones.9223372036854775807
>
> I think the following two lines are supposed to only return one  
> feature with featureId=fid ?
>
> FilterFactory filterFactory =  
> CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
> FeatureCollection features = resource.getFeatures(filterFactory.id(
>                     FeatureUtils.stringToId(filterFactory, fid)));
>
> apparently this is not working, the whole list with features above  
> was returned. I do not know whether this is specific for the WFS  
> layer I am using or the case in general.
>
> Anyway I quickly coded my own filter and things started to work like  
> they should.
>
> cheers,
>  Piebe
>
>
>
>
>
>
>
>
>
>
>
>
>
> Piebe de Vries wrote:
>>
>> I tried two approaches to programatically adjust a feature that has  
>> been newly added by the user.
>> listening as IEditManagerListener to the editmanager
>> and by the editFeatureChanged event
>> I suppose both do more or less the same. Both do not work for me.
>>
>> The first feature added by the user is no problem, I can adjust  
>> some of its values. If the user commits directly after adding the  
>> first feature, the second added feature is no problem either.  
>> However if the user does not commit before adding the second  
>> feature, the events do fire properly but the they contain the first  
>> added feature and not the latest added one. As a result the program  
>> is adjusting the wrong feature.
>>
>> I suppose this is a bug? If not can somebody explain me how to get  
>> the latest added feature. And if it is a bug, is there a way around  
>> for the moment? ( I tried to programmatically commit the feature  
>> after I receive this event, this works but the feature is no longer  
>> visible until the user does an action that refreshes the display)
>>
>> thanks,
>> Piebe
>>
>>
>>
>
>
> -- 
> ---------------------------	----------------------------
>   Piebe de Vries		  piebe.de.vries at geodan.nl
>   Geodan IT b.v.		  Tel: +31 (0)73 - 6925 151
>   President Kennedylaan 1	  Fax: +31 (0)73 - 5711 333
>   1079 MB Amsterdam (NL)	  http://www.geodan.nl
> ---------------------------	----------------------------
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20071105/93a8b1bd/attachment.html


More information about the udig-devel mailing list