It may be the example that is wrong; I can see the
builder.add("Location",Point.class) line ...
can you try and see if there is a builder method to set the default geometry? I
assumed it would pick up the first geometry all on its own ....
Jody
On 07/05/2010, at 1:51 AM, John Cartwright wrote:
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users