Keeping the FID order when creating a shapefile
-----------------------------------------------
Key: GEOT-3606
URL: http://jira.codehaus.org/browse/GEOT-3606
Project: GeoTools
Issue Type: Improvement
Components: data, data shapefile
Affects Versions: 8.0-M0
Environment: GNU-Linux/Debian, Java 6
Reporter: eric grosso
Priority: Minor
The improvement consists in creating shapefiles according to the FID order as
defined in the FeatureCollection the user wants to save.
Therefore in the regular order for ListFeatureCollection or following a map
tree index for MemoryFeatureCollection.
Here is Jody's answer on the geotools mailing list:
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;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel