|
From: Mark A. <ma...@rm...> - 2009-06-16 22:12:53
|
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
|