On Sat, Feb 18, 2012 at 8:17 PM, Chris Nicholas <[email protected]>wrote:
> just following the CSV2Shp example, tinkering with creating shapefiles
> from text, I am getting a curious error when I add the entire collection:
>
> java.io.IOException: Current fid index is null, next must be called before
> write()
> at
> org.geotools.data.shapefile.indexed.IndexedFidWriter.write(IndexedFidWriter.java:250)
> at
> org.geotools.data.shapefile.indexed.IndexedShapefileFeatureWriter.write(IndexedShapefileFeatureWriter.java:100)
> at
> org.geotools.data.shapefile.ShapefileFeatureWriter.close(ShapefileFeatureWriter.java:225)
> at
> org.geotools.data.shapefile.indexed.IndexedShapefileFeatureWriter.close(IndexedShapefileFeatureWriter.java:108)
> at
> org.geotools.data.TransactionStateDiff.applyDiff(TransactionStateDiff.java:265)
> at
> org.geotools.data.TransactionStateDiff.commit(TransactionStateDiff.java:145)
> at
> org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
> at Attr2Shp.main(Attr2Shp.java:241)
>
> hints, suggestions, RTFMs welcomed...
>
>
Making a few shots in the dark here, but afaik:
- the examples are meant to work only with geotools 8 (trunk)
- that particular example works only if you feed it with a very specific
csv format, 4 columns, coord,coord,string,int
- I've tried it with the attached file and it worked for me (save the fact
that the code expected lon/lat and
the coordinates are actually easting/northing in a projected crs)
Cheers
Andrea
--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-------------------------------------------------------
X,Y,str1,cat
593493,4914730,Signature Rock, 1
591950,4923000,No Name, 2
589860,4922000,Canyon Station, 3
590400,4922820,Spearfish Creek, 4
593549,4925500,No Name, 5
600375,4925235,Prairie Site, 6
606635,4920773,Jensen Pass, 7
595755,4925300,No Name, 8
601000,4926310,No Name, 9
602550,4917370,Slaughterhouse Gulch, 10
591635,4924340,No Name, 11
603000,4925250,Elkhorn Peak, 12
592100,4921200,No Name, 13
592600,4922000,No Name, 14
604194,4925980,No Name, 15
608200,4915900,Boulder Creek Cabin, 16
601400,4925450,Ridge, 17
591000,4916000,Cole Creek Mine, 18
607150,4916650,No Name, 19
593690,4914479,No Name, 20
608355,4926490,Whitewood Flats, 21
597945,4918950,Bob Miller, 22
607159,4917000,No Name, 23
591583,4925280,Hanson Ranch, 24
602580,4918480,No Name, 25
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users