0

I have created a GeoServer service with a SQL view. The service is serving rivers. I want to select rivers in a polygon. So I am trying GeoServer demo request tool.

<wfs:GetFeature service="WFS" version="1.0.0"
  outputFormat="GML2"
  xmlns:topp="http://www.openplans.org/topp"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  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-basic.xsd">
  <wfs:Query typeName="topp:rivers">
    <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:Intersects>
        <ogc:PropertyName>geom</ogc:PropertyName>
        <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4321">
          <gml:exterior>
            <gml:LinearRing>
              <gml:posList>78.57 58.32 78.48 24.7 96.89 81.23 51.61 62.41 08.42</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </ogc:Intersects>
   </ogc:Filter>
</wfs:GetFeature>

This request gives an error:

java.lang.RuntimeException: java.io.IOException java.io.IOException null ERROR: Operation on mixed SRID geometries

If my request goes to a service that not created with aSQL view, it works. How can I solve this problem?

2

This error happens when postgres is trying to apply a spatial index with a geometry having one srid, but the data has another.

Are you using a sql view? If so, maybe you setup the wrong srid when creating the sql view? If instead it's a normal view, may it be there are geometries in different srids in it? Postgis has a function to check the srid of a geometry, you should check.

Another possibility for the difference is that qgis is not using any spatial filter... but that would be rather strange.

If you look at Coordinate Reference Systems you see

  • Native SRS
  • Declared SRS

    you should specify declared SRS or Native SRS not both of them.

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.