0

I have a layer in GeoServer and its projection is EPSG:27700. When I query the layer in my app I get and error.

Explanation:

The GeoServer preview displays it correctly. So I copy the JavaScript from the OpenLayers preview page of the layer and use it in my map, and then I compare the browser console for network requests. My map sends an SRS parameter of EPSG:3857 in its requests, whereas the GeoServer preview sends an SRS parameter of EPSG:27700 in it's requests. When I copy the request and past it into the browser I get a WMS file with this seemingly unrelated error message:

Error rendering coverage on the fast path
java.lang.IllegalArgumentException: The reference geometry must be either Polygon, MultiPolygon, or a polygonal PreparedGeometry
The reference geometry must be either Polygon, MultiPolygon, or a polygonal PreparedGeometry

If I manually modify the SRS value in the URL and paste it into the browser again... I get a valid png file.

I assume the SRS it is sending is identifying what the projection of the map object and I cannot change it? Can anyone help me to understand what is going on please?

=== marked as duplicate, although the question linked doesn't help me much === By "copy the request" I meant that Using the browser console I copied the URL my map was firing to GeoServer to request tiles.

The only difference between what my map's URL and the URL from the GeoServer's OpenLayers preview is that the SRS parameter is different.

The GeoServer preview request gets a valid png, the request from my map results in the error mentioned. I guess specifically I want to understand how that results in the error as I cannot understand how referencing a geometry even comes into this scenario.

  • Add here the whole relevant contents of "If I copy the request" that leads to that error message. – user30184 Mar 9 '18 at 15:10
  • Can you post your code? it is possible to make default request in 27700. – neogeomat Mar 12 '18 at 14:27
0

You have to set the srid(projection) in layer definition then the map will request the data from geoserver in the stated projection system.

  • I had tried SRS & PROJECTION - SRID is certainly worth a shot. – Ryan Mar 13 '18 at 13:55
0

The only difference between what my map's url and the url from the GeoServer's openlayers preview is that the SRS parameter is different.

A WMS GetMap request needs a bounding box specified in the SRS of the request, if all you change is the SRS code in the request to get a map, then you almost certainly have an issue with the bounding box (bbox).

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.