From: Jody G. <jga...@re...> - 2007-07-03 17:06:14
|
ELENA BELLODI wrote: > Good morning, > I'd have a question about shapefile I wish you can resolve: I have to do a > java program which reads some coordinates of points from a file (for > exemple csv or txt files) and creates 3 files: .shp, .shx and .dbf (dbf > contains informations relative to each point). Searching through the web > site http://docs.codehaus.org/display/GEOTDOC/Home I haven't understood > what I can download for my purpose, and if there is all I need for my work > already ready in the site. Can you help me?, because it's very urgent! > You should use maven to sort out what you need to download (really it will save you time) - http://docs.codehaus.org/display/GEOTDOC/07+Meet+the+GeoTools+Library At the bottom of that page it shows you want GeoTools jars you need to work with shapefiles. You can download the bin release and dump them all into your IDK but maven hassle. When you get there - here is how you can create a new DataStore file: - http://docs.codehaus.org/display/GEOTDOC/04+How+to+Create+a+DataStore Here is how you can create a FeatureType quickly. - http://docs.codehaus.org/display/GEOTDOC/01+DataUtilities+Utility+Class FeatureType has a create method that you can use to make new features: - http://docs.codehaus.org/display/GEOTDOC/07+FeatureType You can add those to a FeatureCollection: - http://docs.codehaus.org/display/GEOTDOC/08+FeatureCollection And then use a FeatureStore addFeatures method to write them out to your shapefile: - http://docs.codehaus.org/display/GEOTDOC/07+FeatureStore I would not mind using your use case as an example tutorial - but I am booked up today. Would you have time to join me on IRC tomorrow? If not just get on IRC and ask people questions. Cheers, Jody |