1

I'm writing code to import images from a WMS server into some software. However, the software expects the images to be in transverse Mercator, but the WMS server provides it in Mercator. This ends up with images that look like this:

http://i.stack.imgur.com/faPzE.png

http://i.stack.imgur.com/8bl4n.png

Is there some way to transform the image from Mercator to transverse Mercator, assuming I know the EPSG and bounding box of the image?

1

Proj4 is an open-source library for doing cartographic projections. You will need to know the EPSG numbers for your source and target projections.

http://trac.osgeo.org/proj/

A lot of GIS projects use it. We use it in MapDotNet (which is written in C#, so we use a windows build and DLLImport to wrap it).

  • It looks like you can convert coordinates between projections, but is there any way to transform an image between projections in Proj4? – Daniel T Jul 12 '13 at 15:45
  • Hmmm... good question. Your best bet is probably to transform your bounding box coordinates (all four corners) from what you want to what the service provides before requesting the image. The problem with this approach is that, depending on what the projections are, what you are left with may no longer be a valid box. If it is still a box, requesting the image size you want should stretch it pretty much appropriately. If it is not a box then your problem will be much more difficult. – Russell at ISC Jul 15 '13 at 12:57
  • Good idea, I never thought to give the WMS one bounding box then tell the program it's a different one. That could at least get the images to be closer to what I want, if not fix the problem all together. Thanks! – Daniel T Jul 15 '13 at 13:38

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.