Can you do me a favor and try the file in uDig? uDig uses the GeoTools
shapefile support and it "streams" the data onto the screen - so it
never loads it in memory.
Based on your code example it does not look like you are loading it into
memory; I suspect that you are running out of memory while trying to
create an indexfiles; if you check out the wiki page for advice on
connection parameters (ie other than just passing in a url) you should
be avoid creating an index...
Hrm... but you are not using IndexedShapefileDatastore - sounds like we
need more information; is there any *single* geometry in the shapefile
that has a million points in it? Or are they all pretty small...
Jody
> Hello,
>
> I want to read a large Shapefile(3.000.000 lines) but I get a "out of
> memory" Exception.
> Is there another way to get the features from the Shapefile without storing
> the whole file in the memory?
>
> My Code:
>
> ds = new ShapefileDataStore(file.toURL());
> fs = ds.getFeatureSource(); //--> Here the Exception is thrown!
> coll = fs.getFeatures();
> FeatureIterator it = coll.features();
>
> for (int i = 0; i < coll.size(); i++) {
> Feature f = it.next();
> //...
> }
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users