I would like to retrieve an image from a WMS server (see the link below) with python OWSLib (or any other methods).

I know that resolution is 1m per pixel.

For example, I want to get bbox=(54.2652, 18.5889, 54.4189, 18.7866) (epsg 4326).

How can I calculate image size in pixel?



EPSG:4326 does not convert nicely into meters, but you can calculate the lengths of latitude and longitude degrees for example with http://www.csgnetwork.com/degreelenllavcalc.html

At 54°N the length of latitude is 111304.96 m and length of longitude is 65575.75 m.

Your BBOX is 0.1537 degrees high and 0.1977 degrees wide.

HEIGHT = 0.1537 / (1/111304.96) = 17107.57235
WIDTH = 0.1977 / (1/65575.75) = 12964.32578

However, if you really want to have resolution in meters, use some projected coordinate system instead of EPSG:4326. For example UTM zone 35N should be good for Poland http://epsg.io/32635.

  • Thank you for answer. This wms server can give data with epsg.io/2178. It's in meters. – mykolaq Nov 18 '16 at 10:06

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.