Not sure; can you provide a stack trace? 

In general we need:
1) to call "next()" to get a feature which we can fill with the new values.
2) to call "write()" to write those values out to disk

I would recommend using a transaction for this kind of work; so when you call 
"commit" it can write the shapefile file out in one go. If you don't do this 
(i.e. use AUTO_COMMIT) it writes out the whole shapefile file each and every 
time you call write(). 

-- 
Jody Garnett


On Friday, 30 September 2011 at 5:25 PM, filippov70 wrote:

> Hi everyone!
> 
> I have tried to solve my problem as in the example - 
> http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html
> http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html .
> 
> When writing data to a file error occurs: java.io.IOException: Current fid
> index is null, next must be called before write ().
> It happens here:
>  transaction.commit ();
> In debug mode, I find that the error occurs after recording the first object
> in the file.
> 
> 
> I apologize for my bad English (translation google).
> 
> Vladislav.
> 
> --
> View this message in context: 
> http://osgeo-org.1803224.n2.nabble.com/writing-shapefile-problem-tp6846785p6846785.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com 
> (http://Nabble.com).
> 
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2dcopy2
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-users@lists.sourceforge.net 
> (mailto:Geotools-gt2-users@lists.sourceforge.net)
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to