Hi,
I'm new to geotools.  I'm trying to read from a WFS and write the data 
to a shape file.  Reading from
the WFS seems to be working fine, but when I go to create the 
shapefile's schema I get the following
exception:

toShpAction:IOException org.geotools.data.DataSourceException: Cannot 
create a shapefile whose geometry type is class 
com.vividsolutions.jts.geom.Geometry
org.geotools.data.DataSourceException: Cannot create a shapefile whose 
geometrytype is class com.vividsolutions.jts.geom.Geometry
       at 
org.geotools.data.shapefile.ShapefileDataStore.createSchema(ShapefileDataStore.java:804)
 

       at 
hec.dgt.plugins.WfsToShpPlugin.toShpAction(WfsToShpPlugin.java:303)
       at 
hec.dgt.plugins.GageToShpPlugin.doDownload(GageToShpPlugin.java:49)
       at hec.dgt.DgtFrame.downloadData(DgtFrame.java:1076)

 From what I've been able to find, this error can occur when you're 
returned more than one geometry type,
but in this case, at least as far as I'm able to determine, I'm only 
getting points back.

ShapefileDataStore dest;
try
{
   dest = new ShapefileDataStore(f.toURI().toURL());
}
catch (MalformedURLException e)
{
   System.out.println("toShpAction:MalformedURLException "+e);
   e.printStackTrace();
   return;
}

try
{
   dest.createSchema(schema);
}
catch (IOException e)
{
   System.out.println("toShpAction:IOException "+e);
   e.printStackTrace();
   return;
}


I'm using geotools 2.5.5 and Java 1.6 with my code running on windows xp.

Thanks
Mark





------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to