Skip to main content

Hi. I have a WMS service (Aerial) I would like to consume and clip to a JPEG or similar. Is this possible and if so, what transformers would I need to use?

When I open the WMS I currently get an error...

|ERROR |<WMS> Exception detected for the GetMap operation, requested Content-Type, 'image/png', returned Content-Type, 'text/html'.

Eventually, I want to add this to a dwg output.

Any help would be appreciated.

Regards, Paul

 

 

You could use a FeatureReader, if you enter the JPG (or the bounding box of the JPG, e.g. through a BoundingBoxReplacer) as the initiator and set the spatial filter to Bounding Boxes Intersect it'll use that bounding box to clip the data out of the WMS.


Thanks for your response. Your suggestion is exactly the way I wanted to do it.

It seems though I always get returned to the underlying error

<WMS> Exception detected for the GetMap operation, requested Content-Type, 'image/png', returned Content-Type, 'text/html'.

I may have to log a support case to find out about that.

Cheers. Paul


Thanks for your response. Your suggestion is exactly the way I wanted to do it.

It seems though I always get returned to the underlying error

<WMS> Exception detected for the GetMap operation, requested Content-Type, 'image/png', returned Content-Type, 'text/html'.

I may have to log a support case to find out about that.

Cheers. Paul

If a WMS responds with text/html it usually means you messed up the GetMap call.

You either are outside the bound of the WMS, there is some NODATA at your location, or you are not logged in, and the text tells you what the problem is.

Look in the log of the workspace to find the response of the WMS (don't look for errors or warnings, just regular messages).


Thanks so much.

You are correct, I needed to look at what the GetMap tags were expecting. Specifically GetMap&WIDTH=4096&HEIGHT=4096&STYLES=&FORMAT=image/jpeg

Format must also equal the output Format in the Parameters

I also found that the call would not work without the 'Transparent Background' flag ticked.

Hope this helps someone else.

Regards, Paul

 


Thanks so much.

You are correct, I needed to look at what the GetMap tags were expecting. Specifically GetMap&WIDTH=4096&HEIGHT=4096&STYLES=&FORMAT=image/jpeg

Format must also equal the output Format in the Parameters

I also found that the call would not work without the 'Transparent Background' flag ticked.

Hope this helps someone else.

Regards, Paul

 

The transparency thing is due to JPEG not supporting transparency at all, if you need that, see if the WMS offers PNG too.


Reply