I had planned to get through reviewing ContentDataStore classes as the 
CSVDataStore was written. The property-ng datastore is being way more efficient 
as the port comes with existing test cases.

Thus far I have found and fixed the following:

- ContentDataStore.getFeatureWriterAppend - needs to skip to the end of the 
feature writer so users can simple append new content (does anyone use this?)

    public final FeatureWriter<SimpleFeatureType, SimpleFeature> 
getFeatureWriterAppend(String typeName, Transaction tx)
        throws IOException {
        
        ContentFeatureStore featureStore = ensureFeatureStore(typeName,tx);
        FeatureWriter<SimpleFeatureType, SimpleFeature> writer = 
featureStore.getWriter( Filter.INCLUDE , WRITER_ADD );
        
        // ensure we are at the "end" as we are being asked to return this in 
"append" mode
        while( writer.hasNext() ){
            writer.next();
        }
        return writer;
    }


   It would be nicer to rase a "flag" for this (i.e. WRITER_ADD | 
WRITER_APPEND) or have a ContentFeatureStore.canAppend() method.

- ContentFeatureCollection - needs to review the Query and both retype (which 
it was doing) but also reproject ... in order to match the functionality of 
ReprojectFeatureReader

    protected ContentFeatureCollection( ContentFeatureSource featureSource, 
Query query ) {
        this.featureSource = featureSource;
        this.query = query;
        
        this.featureType = featureSource.getSchema();
        if( !featureSource.canReproject() ){
            CoordinateReferenceSystem crs = 
query.getCoordinateSystemReproject() != null
                    ? query.getCoordinateSystemReproject()
                    : query.getCoordinateSystem();
            // retype the feature type if necessary
            if( crs != null && crs != 
featureType.getCoordinateReferenceSystem() ){
                try {
                    this.featureType = FeatureTypes.transform(featureType, crs 
);
                } catch (SchemaException e) {
                    LOGGER.log(Level.FINER, "Unable to transform schema 
requested crs "+e, e);
                }


      ....


-- 
Jody Garnett

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to