PostGIS features with type geometrycollection cause WFS shapefile export to fail
--------------------------------------------------------------------------------
Key: GEOS-3726
URL: http://jira.codehaus.org/browse/GEOS-3726
Project: GeoServer
Issue Type: Bug
Components: WFS
Affects Versions: 1.7.5
Environment: CentOS Linux 5.0; Sun Java 1.6.0; x86_64; gdal-1.4.2-4.el5
Reporter: Daniel Lipsitt
Assignee: Andrea Aime
I have a shapefile imported into a PostGIS DB with {{ogr2ogr}}. The layer renders in WMS, but WFS export using {{outputFormat=SHAPE-ZIP}} fails with the following error:
{code:xml}
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>
java.lang.RuntimeException: This should never happen, there&apos;s
a bug in the SHAPE-ZIP output format. I got a geometry of type class
com.vividsolutions.jts.geom.GeometryCollection This should never
happen, there&apos;s a bug in the SHAPE-ZIP output format. I got a
geometry of type class com.vividsolutions.jts.geom.GeometryCollection
</ows:ExceptionText>
</ows:Exception>
{code}
This error is coming from {{wfs/response/ShapeZipOutputFormat.java}}
Here's what I see in Postgres:
{code:sql}
select geometrytype(wkb_geometry) as type, count(*) from mytable
group by type;
type | count
--------------------+-------
POLYGON | 289
MULTIPOLYGON | 3
GEOMETRYCOLLECTION | 1
select st_astext(wkb_geometry) from mytable
where geometrytype(wkb_geometry) = 'GEOMETRYCOLLECTION';
st_astext
--------------------------
GEOMETRYCOLLECTION EMPTY
{code}
So you can see that the table contains one empty {{geometrycollection}} row. This is how it was created by {{ogr2ogr}} with the {{-nlt GEOMETRY}} flag.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira