Indexed Shapefile support was still an experiment at this time for 
GeoTools 2.3... for GeoTools 2.4 the experiment was ended and there is 
now a single
ShapefileDataStoreFactory that should do all the logic needed to set you 
up with ShapeFileDataStore or IndexedShapefileDataStore as needed...

I think (if I read the code right) that you can specify a "create 
spatial index" flag; or it will pick up if an index file is there or not.

In this case the docs are up to date:
- http://docs.codehaus.org/display/GEOTDOC/Shapefile+Plugin

However I think you are going to be the first person other than a test 
case to tell me if this code works :-(
So I gotta ask; how are you making your IndexedShapeDataStore? Using 
DataStoreFactoryFinder ...or by hand?

Jody


> I apparently have some shape files which are not indexed, so when JMapPane 
> tries to render them,
> it throws an exception:
>
> Dec 18, 2007 3:20:22 PM org.geotools.renderer.lite.StreamingRenderer 
> processStylers
> SEVERE: null
> java.util.NoSuchElementException
>         at 
> org.geotools.data.shapefile.indexed.IndexedFidReader.next(IndexedFidReader.java:263)
>         at 
> org.geotools.data.FIDFeatureReader.readFeature(FIDFeatureReader.java:119)
>         at org.geotools.data.FIDFeatureReader.next(FIDFeatureReader.java:94)
>         at 
> org.geotools.data.store.FeatureReaderIterator.next(FeatureReaderIterator.java:64)
>         at 
> org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1570)
>         at 
> org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:617)
>         at 
> org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:481)
>         at 
> org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:430)
>         at nz.co.niwa.geotools.JMapPane.paintComponent(JMapPane.java:480)
>
>
> The IndexedShapeFileReader per se does not throw any exception, if it did I 
> could catch it and pick the ShapeFileReader instead. 
> Any way I can check before hand which reader is appropriate?
> Gaby
>
>
> ***************************************************************
> **     Gabriella Turek               [EMAIL PROTECTED]      **
> ** National Institute of Water & Atmospheric Research (NIWA) **
> ** PO Box 8602 Christchurch New Zealand    +64-3-343-8067    **
> ***************************************************************
>
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to