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.
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
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