Hi Bernhard,
actually the point is that in line 4 you're requesting to load all the
features in memory, which may be isn't what you really wanted.
try doing just
col = features.getFeatures();
instead of
features.getFeatures().collection();
That way you'll obtain a "streamed" feature collection, whose contents you can
traverse by asking it for an iterator:
FeatureIterator it = col.features();
Hope that helps,
Gabriel.
On Monday 09 January 2006 12:33, James Brown wrote:
> Dear Bernhard,
>
> You can increase the memory available to the JVM. I think it defaults to
> 128MB. You should be able to set this within your IDE.
>
> Alternatively, if you are running a jar file from the command line, try:
>
> start javaw -jar -Xms64min -Xmx500m YOUR_JAR.jar
>
> where 64 is the minimum allocation and 500 is the max (MB).
>
> James
>
> > Hi list,
> >
> > I'm doing the following:
> >
> > 1: theShape = new File("/path/to/shape.shp");
> > 2: DataStore store = new ShapefileDataStore(theShape.toURL());
> > 3: FeatureSource features =
> > store.getFeatureSource(store.getTypeNames()[0]);
> > 4: FeatureCollection col = features.getFeatures().collection();
> > 5: System.out.println("Grundstücke: " + col.size());
> >
> > after executing line 3, the following warnings appear at the console:
> > 09.01.2006 12:18:54 org.geotools.data.shapefile.ShapefileDataStore
> > openPrjReader
> > WARNUNG: projection (.prj) for shapefile not available
> > 09.01.2006 12:18:54 org.geotools.data.shapefile.ShapefileDataStore
> > openPrjReader
> > WARNUNG: projection (.prj) for shapefile not available
> >
> > yes, they appear twice...
> >
> > before finishing line 4, it throws the following:
> > Exception in thread "AWT-EventQueue-1" java.lang.OutOfMemoryError: Java
> > heap space
> >
> > Line 5 is never reached.
> >
> > Does that mean that the shapefile is simply too big? What can I do to
> > avoid the warnings, or don't they effect me anyways?
> >
> > greetings
> > Bernhard
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > files
> > for problems? Stop! Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > _______________________________________________
> > Geotools-gt2-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=Click
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
--
Gabriel Roldán ([EMAIL PROTECTED])
Axios Engineering (http://www.axios.es)
Tel. +34 944 41 63 84
Fax. +34 944 41 64 90
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users