Hello All,

I'm trying to follow the very nice Csv2Shp example
(http://geotools.org/examples/csv2shp.html) using version 2.6.3 and am
having a little trouble.

Using the recommended alternative method for creating a SimpleFeatureType:

private static SimpleFeatureType createFeatureType() {

        SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
        builder.setName("Location");
        builder.setCRS(DefaultGeographicCRS.WGS84); // <- Coordinate reference 
system

        // add attributes in order
        builder.add("Location", Point.class);
        builder.length(15).add("Name", String.class); // <- 15 chars width for 
name field

        // build the type
        final SimpleFeatureType LOCATION = builder.buildFeatureType();

        return LOCATION;
    }

I find that the subsequent call "newDataStore.createSchema(TYPE);" throws a 
NPE, apparently because the the 
GeometryDescriptor is null (ShapefileDataStore.java: line 815).

Can someone please explain what I'm doing wrong here?

Thanks!

--john




------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to