[Geoserver-devel] [jira] Created: (GEOS-661) SHAPE-ZIP returns empty files when real files do exist

SHAPE-ZIP returns empty files when real files do exist
------------------------------------------------------

                 Key: GEOS-661
                 URL: http://jira.codehaus.org/browse/GEOS-661
             Project: GeoServer
          Issue Type: Bug
            Reporter: Brent Owens
         Assigned To: Brent Owens
            Priority: Minor
             Fix For: 1.3.x

This might not be a bug. It might be a problem with permissions. Environment is Tomcat.

The temporary shapefiles created with WFS SHAPE-ZIP are sometimes returning empty files, but the files do exist in the temp direcory and have data. Here is an excerpt from the emails:

Problem 1 -

Curiously when I attempt a SHAPE-ZIP query on localhost with a
filter clause
on a datasource made up of LineString geometry the return is an
empty file,
but in only some cases involving a smaller BBox. (using
TestWfsPost) Same
Query with a larger Bbox works fine?

The same Query on an identical online server appears to work
correctly?
(both online and remote services localhost) which would seem to
indicate a
permission problem with the local server.

I see that the empty result localhost Queries do create a valid
shape file
set in the Tomcat temp directory. However, the CREATOR/OWNER has full
control permissions for the Tomcat temp folder. If permissions were a
problem the larger Bbox should not work either?

Testing Environment for localhost and online server:
GeoServer 1.3.2 war, PostGIS 1.1.2, Tomcat 5.5.12, Windows 2003 server

Case 1 - Bbox filter against http://localhost:80/geoserver/wfs:
returns an
empty file.
Notes:
  Identical query except for <gml:coordinates>-125.0,23.0
-65.0,53.0</gml:coordinates> works fine.
  outputFormat "GML2" results in a valid xml result.
  No warnings or errors in log but an empty zip file.
  Valid shp file set is created in the Tomcat temp subdirectory
  Problem appears related to size of BBox

<?xml version='1.0' encoding='UTF-16' standalone='yes'?>
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="SHAPE-ZIP"
  xmlns:geo="http://web-maps.com/geo&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-
basic.xsd">
  <wfs:Query typeName="geo:interstate">
    <ogc:Filter>
      <ogc:BBOX>
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <gml:Box srsName="http://www.opengis.net/gml/srs/
epsg.xml#4269">
           <gml:coordinates>-91.53543472290039,37.17322826385498
-89.1732292175293,39.53543281555176</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Problem 2 -

Switching to a Query of a Polygon datasource results in a
"java.io.IOException: Unable to write : java.math.BigDecimal" for
Shape
Dbase Header

- localhost and online - polygon data
<?xml version='1.0' encoding='UTF-16' standalone='yes'?>
<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="SHAPE-ZIP"
  xmlns:geo="http://web-maps.com/geo&quot;
  xmlns:wfs="http://www.opengis.net/wfs&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.0.0/WFS-
basic.xsd">
  <wfs:Query typeName="geo:state">
    <ogc:Filter>
      <ogc:BBOX>
        <ogc:PropertyName>the_geom</ogc:PropertyName>
        <gml:Box srsName="http://www.opengis.net/gml/srs/
epsg.xml#4269">
           <gml:coordinates>-91.53543472290039,37.17322826385498
-89.1732292175293,39.53543281555176</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

Gives this exception:

<?xml version="1.0" ?>
<ServiceExceptionReport
   version="1.2.0"
   xmlns="http://www.opengis.net/ogc&quot;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation="http://www.opengis.net/ogc
http://localhost:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
   <ServiceException>
      java.io.IOException: Unable to write : java.math.BigDecimal
</ServiceException>
</ServiceExceptionReport>

Log file entry:

45645285 [INFO] org.vfny.geoserver.servlets.AbstractService -
java.io.IOException: Unable to write : java.math.BigDecimal
  at
org.geotools.data.shapefile.ShapefileDataStore.createDbaseHeader
(ShapefileDa
taStore.java:1046)
  at
org.geotools.data.shapefile.ShapefileDataStore.createSchema
(ShapefileDataSto
re.java:769)
  at
org.vfny.geoserver.wfs.responses.ShapeFeatureResponseDelegate.writeOut
(Shape
FeatureResponseDelegate.java:301)
  at
  .
  .
  .

--
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