I have a postgis data with 777 features. In geoserver, i created a sql view with another table. In the wms request i can see all features, in qgis also i can see all features. but in wfs output as csv or geojson i only get 55 features. On doing wfs with openlayers it gives error

<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.RuntimeException: Failed to get property: gid
Failed to get property: gid
java.lang.String cannot be cast to com.vividsolutions.jts.geom.Geometry</ows:ExceptionText>

I suspect that (at least one of) your features has geometry errors. Although you have 777 features only 55 of them are properly exported. So it must be a problem beginning with the 56th feature. This is all I can read from your ExceptionReport.

In your case, I see two options for you to explore:

1) To load your features into QGIS again and go to Vector > Geometry Tools > Multipart to Singleparts as in the image below:

enter image description here

Then save your data in your server, and repeat the wfs output process. If you are not lucky enough, and the error persists, I advise you to 2) and to perform a geometry validity on your data;

2) In QGIS you'll go to Vector > Geometry Tools > Check geometry validity:

enter image description here

If you'll encounter Geometry errors (like bellow), you must solve and save them into your database, prior to repeat the wfs outputing.

If these doesn't solve your problem, then check your GeoServer log for additional possible causes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.