Glancing over those docs, I don't think we'll have any problems with it. 
It's a good 'standard' to shoot for.

I do have some more questions about writing-a-csv. I finally got into 
implementing the CSVFeatureWriter and I'm not sure how to fit it into 
ContentFeatureStore, etc. Allow me to ramble a bit..

For starters, I'm working on this API:

    SimpleFeatureStore.modifyFeatures(String name, Object 
attributeValue, Filter filter).

My understanding of that API is that the resulting csv file will contain 
the same rows as before, in the same order, but with the specified 
attribute updated in just those rows that match the filter. Correct?  If 
so, let's examine the implementation of modifyFeatures in 
ContentFeatureStore:

         FeatureWriter<SimpleFeatureType, SimpleFeature> writer = 
getWriter(filter, WRITER_UPDATE);
         try {
             while (writer.hasNext()) {
                 SimpleFeature toWrite = writer.next();
                 for (int i = 0; i < type.length; i++) {
                     toWrite.setAttribute(type[i], value[i]);
                 }
                 writer.write();
             }
         } finally {
             writer.close();
         }

It gets a FeatureWriter that, presumably, delivers just those rows that 
match the filter. But if the writer actually writes out the modified 
rows to a file, then you end up with just the modified rows and not the 
rest. Alternatively, the writer could operate on an in-memory structure 
containing all the rows and not write out to a file until the whole 
modifyFeatures is done, but I assum we want to be able to handle very 
large files and therefore an in-memory copy of the whole file is not 
desirable. True?  It seems like the only way to make it work is to 
override modifyFeatures in CSVFeatureWriter and make it work for the 
particular limitations that CSV files require, but that seems not-great 
either.

Suggestions?

Thanks,

Lee

On 5/11/2011 8:26 AM, Andrea Aime wrote:
> Adding one late observation to the thread. While there are few
> standards it would
> be nice if the tool could cooperate, to some extent, with the way OGR
> handles csv files, see here:
>
> http://www.gdal.org/ogr/drv_csv.html
>
> Cheers
> Andrea
>
>


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to