Well this mystery is not more of a mystery; because uDig is using the
same code (actually it uses GeoTools 2.2 - you could try your
application w/ GeoTools 2.2?)
Now that you have opened the file in uDig (which may be set up to use
more memory) try your application again ... now that the index file has been
created perhaps everything will be good? Also try IndexedShapefile and
non IndexedShapefile.
Jody
> Hello Jody,
>
> thank you for your reply!
>
> I tried the shapefile in uDig and it was displayed without errors.
>
> The shapefile consists of approx. 3 million linestrings only with a start-
> and endnode.(It is an ESRI TINfile saved as shapefile)And I need the
> coordinates of each start- and endnode of each line.
>
> DHIste
>
>
> Jody Garnett wrote:
>
>> 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
>>
>>
>>
>
>
-------------------------------------------------------------------------
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