Gérald Quintana ha scritto:
> Hello,
>
> I am trying to create a shape file data store with GeoTools 2.4M4
> (inputDataStore is GMLDataStore):
> ShapefileDataStoreFactory outputDataStoreFactory = new
> ShapefileDataStoreFactory();
> DataStore outputDataStore = outputDataStoreFactory.createDataStore(new
> URL(outputShapeFile));
> FeatureType featureType = inputDataStore.getSchema(typeName);
> outputDataStore.createSchema(featureType);
>
> But I get a NPE:
> java.lang.NullPointerException
> at
> org.geotools.data.shapefile.ShapefileDataStore.createSchema(ShapefileDataStore.java:762)
>
> What's wrong ? What did I miss?
Hmmm... hard to say since the class changed a bit and current version
has a comment at line 762, but anyways, looking at the first lines
of the createSchema method:
CoordinateReferenceSystem cs =
featureType.getDefaultGeometry().getCoordinateSystem();
long temp = System.currentTimeMillis();
if (isLocal()) {
Class geomType = featureType.getDefaultGeometry().getType();
it's either that the feature type is null, or that the feature type has
no default geometry. Why this is happening, I don't know.
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users