0

I have a flat 400x400 pixels image which represents an area of 400x400 kilometers. I need to draw this image as an overlay on my OpenLayers mapping system. I use OpenStreetMap/Google Maps as base layers. I want to draw the overlay image using an Image Layer and I want to center my overlay image at a specific lat/lon point. The projection of the base layer is EPSG:900913 which is, in fact, the projection used by OpenStreetMap and Google Maps.

What I have understood (please correct me if I'm wrong), is that I can't use a flat, 'unprojected' image as an Image Layer, but I have to do a sort of 'reprojecting' to adjust the image to be compliant with the projection of the map, which is EPSG:900913. Searching here and the net, it seems I should use a library/tool called GDAL to do this, but whereas I am completely new to this I ask you:

  • Can anyone address me on how to use it?
  • Could you possibly tell me if what I have just said is correct and the way I described here is valid?
  • How could I use gdal to translate my flat unprojected 400x400 pixels image to an image projected in EPSG:900913, and suitable to be put as an Image Layer as an overlay?

Thanks.

  • do you mean u have image of resolution 1kmX1km? – poshan Sep 23 '13 at 14:06
  • 1
    Is your image georeferenced (as opposed to just an image from, say, Photoshop)? – MappaGnosis Sep 23 '13 at 14:50
  • @poshanniraula: yes the resolution of the image is 1km per pixel. – Magallo Sep 25 '13 at 16:16
  • @MappaGnosis: no, my image isn't georeferenced. Is just a simple png image 400x400 pixels. I know its center point, i.e. where I should place it in my map, in lat/lon coordinates but the image file has no reference about it inside its structure data. It's just a plain and simple png image. – Magallo Sep 25 '13 at 16:17
  • To edit and make your question clearer my recommendation is to focus on getting an answer to just one (the most important one) of your three questions first. – PolyGeo Sep 25 '13 at 20:56
1

The first thing you need to do is georeference your image. If you happen to know the exact location of your upper left-hand corner of the image in real world coordinates you can manually create a world file.

If you don't, then the simplest way to georeference your image is to use a GIS like QGIS, ArcGIS or others (QGIS is free) and go Raster->Georeferencer->Georefernce. Load your image in the new window which opens. To make life easy, get some data with easily recognizable features that correspond to your image and load it into QGIS (the main window not the georeferencing one). In the georeferencing window, click a location you can recognise then either enter its coordinates or select the 'Indentify on map' button (which takes you to the map you loaded into the main QGIS window, where you can click on a corresponding location). This process adds control points to your image. Once you have three or four, click the green georefernce arrow in the top menu.

Your best bet is to georeference the image as EPSG 900913 (or 3857 - same thing) and this will save you trouble later on. Once your image is georeferenced to EPSG:900913, OpenLayers will do the rest.

  • Thanks for the answer. My doubt is: to georeference the image, should I convert it from png to GeoTIFF? How to convert it? Does OpenLayers support GeoTIFF images as external graphic url in the vector layer? Once georeferenced, the image is still a simple square 400x400 pixels image with some georeferencial metadata, or is it stretched/modified? When you say "OpenLayers will do the rest", what do you mean? – Magallo Apr 7 '14 at 15:21

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.