Issue closed; patch was straight forward (thanks for the review Eric). I also 
updated the code to use Java generics making it easier to follow.

-- 
Jody Garnett


On Thursday, 26 May 2011 at 11:01 PM, Michael Bedward wrote:

> Watching with interest :)
> 
> Michael
> 
> 
> On 26 May 2011 21:52, Eric Grosso <[email protected] 
> (mailto:[email protected])> wrote:
> > Thanks Michael, Andrea and Jody for your answer.
> > 
> > @Andrea: you will find in attachment a quick and dirty test class and some
> > relative data to check the result.
> > Just change the shapeURLSource and shapeURLTarget parameters in the main
> > method to test it.
> > 
> > @Jody: the report has been created as a minor improvement in JIRA --
> > http://jira.codehaus.org/browse/GEOT-3606 --
> > 
> > Cheers,
> > Eric
> > 
> > 
> > On 26 May 2011 13:08, Jody Garnett <[email protected] 
> > (mailto:[email protected])> wrote:
> > > 
> > > Thinking about that for a moment.
> > > Internally (until you hit commit) the features are held in memory in a
> > > TransactionStateDiff; and then they are written out when commit() is 
> > > called.
> > > What is the bet that that data structure uses a HashMap internally; I
> > > think if we change it to use a ListMap then the functionality you wanted
> > > would be preserved?
> > > Here is the variable:
> > > /**
> > >  * Map of differences by typeName.
> > >  *
> > >  * <p>
> > >  * Differences are stored as a Map of Feature by fid, and are reset
> > > during
> > >  * a commit() or rollback().
> > >  * </p>
> > >  */
> > > Map typeNameDiff = new HashMap();
> > > Looking at the code a bit more I am updating that to be:
> > > As for Diff?
> > > public class Diff{
> > > private final Map modifiedFeatures;
> > > private final Map addedFeatures;
> > > And yes they are set to a form of HashMap:
> > > public Diff( ){
> > > modifiedFeatures=new ConcurrentHashMap();
> > > addedFeatures=new ConcurrentHashMap();
> > > modified2=Collections.unmodifiableMap(modifiedFeatures);
> > > added=Collections.unmodifiableMap(addedFeatures);
> > > spatialIndex=new Quadtree();
> > > mutex=this;
> > > }
> > > So i will make you a deal; repot this bug in Jira; I will try commiting a
> > > fix; and you can tell me if it works.
> > > --
> > > Jody Garnett
> > > 
> > > On Thursday, 26 May 2011 at 6:43 PM, Eric Grosso wrote:
> > > 
> > > Hi,
> > > 
> > > I would like to keep the FID order such as defined in a FeatureCollection
> > > in
> > > a produced shapefile. I used a ListFeatureCollection in order to avoid the
> > > default behaviour of the FeatureCollection implementation which is in link
> > > with MemoryFeatureCollection.
> > > 
> > > This approach follows the one recommended in an another message posted in
> > > this list (last September):
> > > 
> > > http://osgeo-org.1803224.n2.nabble.com/Maintaining-line-order-when-creating-a-shapefile-tt5537984.html
> > > 
> > > It doesn't work: when the shapefile is created, the order isn't the same
> > > at
> > > all. Is there any solution to do it?
> > > 
> > > Thanks for your answer.
> > > 
> > > Cheers,
> > > Eric
> > > 
> > > --
> > > View this message in context:
> > > http://osgeo-org.1803224.n2.nabble.com/Keeping-the-FID-order-when-creating-a-shapefile-tp6406169p6406169.html
> > > Sent from the geotools-gt2-users mailing list archive at Nabble.com 
> > > (http://Nabble.com).
> > > 
> > > 
> > > ------------------------------------------------------------------------------
> > > vRanger cuts backup time in half-while increasing security.
> > > With the market-leading solution for virtual backup and recovery,
> > > you get blazing-fast, flexible, and affordable data protection.
> > > Download your free trial now.
> > > http://p.sf.net/sfu/quest-d2dcopy1
> > > _______________________________________________
> > > Geotools-gt2-users mailing list
> > > [email protected] 
> > > (mailto:[email protected])
> > > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> > 
> > 
> > ------------------------------------------------------------------------------
> > vRanger cuts backup time in half-while increasing security.
> > With the market-leading solution for virtual backup and recovery,
> > you get blazing-fast, flexible, and affordable data protection.
> > Download your free trial now.
> > http://p.sf.net/sfu/quest-d2dcopy1
> > _______________________________________________
> > Geotools-gt2-users mailing list
> > [email protected] 
> > (mailto:[email protected])
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to