More

How to display a geotiff-image with OpenLayers at the “right place”?


I'm just starting with OpenLayers. I have a georeferenced geotiff and the associated world file. Now I want to display this image as an Overlay and google-maps as baselayer with OpenLayers. Would be nice if anybody has some hints? How to get started in the right way? thanks, southente


OpenLayers supports projections.

You should know the current projection of your GeoTIFF and specify it to the layer, as EPSG code.

If you have no idea of your GeoTIFF file projection, use GDAL to know it.

In command line :

gdalinfo ./path/to/your/geo.tif

You will get back the desired information

If you don't know the EPSG code, you can get it using http://spatialreference.org/

Some examples are on OpenLayers' website :

Also, reading that page would give you some basics on how projections are handled.


The MapTiler (http://www.maptiler.com/) can be used to turn any GeoTIFF or an image with world file into a Google Maps overlay or into standalone web viewer with OpenLayers.

You just have to drag&drop the file into MapTiler and choose what sort of tiles you want to generate (if standard Mercator tiles a la Google Maps or tiles in local coordinate system or raster tiles).

The software will crunch the file, apply coordinate transformation to put the image on the right place and it produces a set of sample JavaScript viewers - powered by OpenLayers, Leaflet, Google Maps API, etc.

This way you get a ready to use JavaScript code showing your GeoTIFF - and you can start to add your own functionality (markers, place search, polygons, layer switcher, custom design and branding, etc).

If your file is a proper GeoTIFF with the geographical location and coordinate system definition embedded then the software will load it automatically as in this video: https://www.youtube.com/watch?v=-rSYFwcWVnc&list=PLGHe6Moaz52PiQd1mO-S9QrCjqSn1v-ay&index=12

If you have a World file, but the coordinate system information is missing you can specify it easily: http://www.maptiler.com/how-to/coordinate-systems/

To turn an ordinary scanned maps without any location info into a map overlay see this video: http://www.maptiler.com/how-to/overlay-image-over-map/