SHAPE-ZIP returns empty files when real files do exist
Description
Environment
Activity
codehaus April 10, 2015 at 4:24 PM
CodeHaus Comment From: aaime - Time: Tue, 31 Oct 2006 07:53:31 -0600
---------------------
<p>Today I managed to reproduce the error by accident. It's something that happened only with shapefile-zip and the partial buffer strategy with responses smaller than the 20k buffer... fixed on 1.4.x, will be released along with 1.4.0rc3</p>
codehaus April 10, 2015 at 4:24 PM
CodeHaus Comment From: aaime - Time: Thu, 5 Oct 2006 10:23:52 -0500
---------------------
<p>Problem 2 is fixed in another issue, Problem 1 cannot be reproduced</p>
codehaus April 10, 2015 at 4:24 PM
CodeHaus Comment From: aaime - Time: Thu, 5 Oct 2006 10:22:58 -0500
---------------------
<p>George Randy provided me with a dataset and a query to run, and could not reproduce his problem.
Moveover, he confirmed me that he could reproduce the problem on one computer only, so it seems
a PC related problem, not a geoserver one. Closing the issue for the moment.</p>
codehaus April 10, 2015 at 4:24 PM
CodeHaus Comment From: aaime - Time: Tue, 3 Oct 2006 12:02:30 -0500
---------------------
<p>The second exception is in fact a limitation of the shapefile data store.
The jdbc data stores do map Types.DECIMAL and Types.NUMERIC to BigDecimal class, but the shapefile datastore is not able to handle that kind of data type. References: Jdbc1DataStore, line 174, and ShapefileDataStore, line 1025.
So, the second one is really <a href="https://jira.codehaus.org/browse/GEOS-715" title="Shapefile big decimal error" class="issue-link" data-issue-key="GEOS-715"><del>GEOS-715</del></a>.</p>
<p>The first one exception is strange... can you provide me with a dump of this postgis database so that I can try to reproduce it?</p>
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: - 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"
> xmlns:wfs="http://www.opengis.net/wfs"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS- - http://schemas.opengis.net/wfs/1.0.0/WFS-
> basic.xsd">
> <wfs:Query typeName="geo:interstate">
> <ogc:Filter>
> <ogc:BBOX>
> <ogcropertyName>the_geom</ogcropertyName>
> <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"
> xmlns:wfs="http://www.opengis.net/wfs"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS- - http://schemas.opengis.net/wfs/1.0.0/WFS-
> basic.xsd">
> <wfs:Query typeName="geo:state">
> <ogc:Filter>
> <ogc:BBOX>
> <ogcropertyName>the_geom</ogcropertyName>
> <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"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.opengis.net/ogc
> http://localhost:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd - http://localhost:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd">
> <ServiceException>
> java.io.IOException: Unable to write : java.math.BigDecimal
> </ServiceException>
> </ServiceExceptionReport>
>
> Log file entry:
>
> 45645285 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
> .
> .
> .