2015-08-18 13:19 GMT+02:00 Augustin Doury <augustindo...@gmail.com>: > Hi all, > > I try to learn how to create a shapefile with Geotools following > Csv2Shape tutorial [1]. > > Most of the code (below) is exactly the same as the tutorial code. I > used the csv file as suggested in the tutorial [2]. > I just : > 1) changed the line > "SimpleFeatureCollection collection = > FeatureCollections.newCollection();" > by > "SimpleFeatureCollection collection = new > DefaultFeatureCollection(null,null);" > because FeatureCollections seems deprecated. > 2) add a dependency to the pom.xml > <dependency> > <groupId>org.geotools</groupId> > <artifactId>gt-epsg-hsql</artifactId> > <version>${geotools.version}</version> > </dependency> > > *Problem* : the created shapefile does not seem to have geometries : > - when I print the shapefile in QGIS or using the QuickStart > application, it's empty. >
this is because the geometry field for a shapefile has to be called "the _geom" (you're using "location") see the updated/fixed version in: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html#create-a-featuretype > > + I don't understand why the last line of the Main > System.out.println("This sentence doesn't print ..."); > does not print ... > > because you are calling system.exit so the program terminates before it gets there. > Hope somebody here can help me again, thank you ! > > HTH, Mark -- Disclaimer; This message is just a reflection of what I thought at the time of sending. The message may contain information that is not intended for you or that you don't understand.
------------------------------------------------------------------------------
_______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users